--- rxvt-unicode/src/main.C 2006/02/12 09:44:04 1.222 +++ rxvt-unicode/src/main.C 2006/08/18 23:03:31 1.229 @@ -1,4 +1,4 @@ -/*--------------------------------*-C-*---------------------------------* +/*----------------------------------------------------------------------* * File: main.C *----------------------------------------------------------------------* * @@ -58,10 +58,15 @@ bool rxvt_set_locale (const char *locale) NOTHROW { - if (!locale || !strncmp (locale, curlocale, 128)) + int size = strlen (locale) + 1; + + if (size > sizeof (curlocale)) + rxvt_fatal ("locale string too long, aborting.\n"); + + if (!locale || !memcmp (locale, curlocale, size)) return false; - strncpy (curlocale, locale, 128); + memcpy (curlocale, locale, size); setlocale (LC_CTYPE, curlocale); return true; } @@ -145,7 +150,7 @@ rxvt_term::rxvt_term () : -#if TRANSPARENT +#if TRANSPARENT || ENABLE_PERL rootwin_ev (this, &rxvt_term::rootwin_cb), #endif #ifdef HAVE_SCROLLBARS @@ -200,6 +205,7 @@ if (cmd_pid) kill (-cmd_pid, SIGHUP); + pty_ev.stop (); delete pty; pty = 0; } @@ -266,9 +272,9 @@ clear (); } - delete pix_colors_focused; + delete [] pix_colors_focused; #if OFF_FOCUS_FADING - delete pix_colors_unfocused; + delete [] pix_colors_unfocused; #endif displays.put (display); @@ -327,7 +333,7 @@ #if HAVE_SCROLLBARS scrollbar_ev.stop (display); #endif -#if TRANSPARENT +#if TRANSPARENT || ENABLE_PERL rootwin_ev.stop (display); #endif incr_ev.stop (); @@ -505,6 +511,9 @@ rootwin_ev.start (display, display->root); } #endif +#if ENABLE_PERL + rootwin_ev.start (display, display->root); +#endif set_colorfgbg (); @@ -937,18 +946,9 @@ /* XSetWindowAttributes attr; */ /* Cursor cursor; */ done: - -#if OFF_FOCUS_FADING - if (rs[Rs_fade]) - { - rgba c; - pix_colors [Color_fade].get (c); - pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); - } -#endif - /*TODO: handle Color_BD, scrollbar background, etc. */ + update_fade_color (idx); recolour_cursor (); scr_recolour (); }