--- rxvt-unicode/src/init.C 2007/11/26 10:33:36 1.223 +++ rxvt-unicode/src/init.C 2007/12/31 15:45:29 1.237 @@ -12,9 +12,7 @@ * Copyright (c) 1997,1998 Oezguer Kesim * Copyright (c) 1998-2001 Geoff Wing * - extensive modifications - * Copyright (c) 1999 D J Hawkey Jr - * - QNX support - * Copyright (c) 2003-2006 Marc Lehmann + * Copyright (c) 2003-2007 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,6 +41,8 @@ #include +#include + #ifdef HAVE_XSETLOCALE # define X_LOCALE # include @@ -280,15 +280,10 @@ #endif }; -bool +void rxvt_term::init_vars () { - pix_colors = // - pix_colors_focused = new rxvt_color [TOTAL_COLORS]; -#ifdef OFF_FOCUS_FADING - pix_colors_unfocused = new rxvt_color [TOTAL_COLORS]; -#endif - + pix_colors = pix_colors_focused; MEvent.time = CurrentTime; MEvent.button = AnyButton; @@ -300,12 +295,10 @@ ext_bwidth = EXTERNALBORDERWIDTH; lineSpace = LINESPACE; saveLines = SAVELINES; - numpix_colors = TOTAL_COLORS; refresh_type = SLOW_REFRESH; oldcursor.row = oldcursor.col = -1; - last_bot = last_state = -1; set_option (Opt_scrollBar); set_option (Opt_scrollTtyOutput); @@ -316,8 +309,6 @@ set_option (Opt_pastableTabs); set_option (Opt_intensityStyles); set_option (Opt_iso14755_52); - - return true; } void @@ -418,6 +409,8 @@ #endif #ifdef HAVE_AFTERIMAGE + set_application_name ((char*)rs[Rs_name]); + set_output_threshold (OUTPUT_LEVEL_WARNING); asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL); #endif free (r_argv); @@ -1122,15 +1115,6 @@ drawable = new rxvt_drawable (this, vt); -#ifdef RXVT_SCROLLBAR - gcvalue.foreground = pix_colors[Color_topShadow]; - topShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); - gcvalue.foreground = pix_colors[Color_bottomShadow]; - botShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); - gcvalue.foreground = pix_colors[ (depth <= 2 ? Color_fg : Color_scroll)]; - scrollbarGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); -#endif - #ifdef OFF_FOCUS_FADING // initially we are in unfocused state if (rs[Rs_fade]) @@ -1145,16 +1129,16 @@ * GET TTY CURRENT STATE * * ------------------------------------------------------------------------- */ void -rxvt_get_ttymode (ttymode_t *tio, int erase) +rxvt_get_ttymode (struct termios *tio, int erase) { /* * standard System V termios interface */ - if (GET_TERMIOS (STDIN_FILENO, tio) < 0) + if (tcgetattr (STDIN_FILENO, tio) < 0) { // return error - use system defaults, // where possible, and zero elsewhere - memset (tio, 0, sizeof (ttymode_t)); + memset (tio, 0, sizeof (struct termios)); tio->c_cc[VINTR] = CINTR; tio->c_cc[VQUIT] = CQUIT; @@ -1228,7 +1212,6 @@ * Debugging */ #ifdef DEBUG_TTYMODE -#ifdef HAVE_TERMIOS_H /* c_iflag bits */ fprintf (stderr, "Input flags\n"); @@ -1301,7 +1284,6 @@ fprintf (stderr, "\n"); # undef FOO -# endif /* HAVE_TERMIOS_H */ #endif /* DEBUG_TTYMODE */ } @@ -1345,7 +1327,10 @@ er = -1; rxvt_get_ttymode (&tio, er); - SET_TERMIOS (pty->tty, &tio); /* init terminal attributes */ + /* init terminal attributes */ + cfsetospeed (&tio, BAUDRATE); + cfsetispeed (&tio, BAUDRATE); + tcsetattr (pty->tty, TCSANOW, &tio); pty->set_utf8_mode (enc_utf8); /* set initial window size */ @@ -1415,7 +1400,8 @@ char *login; if (option (Opt_console)) - { /* be virtual console, fail silently */ + { + /* be virtual console, fail silently */ #ifdef TIOCCONS unsigned int on = 1;