--- rxvt-unicode/src/command.C 2007/12/18 13:07:55 1.384 +++ rxvt-unicode/src/command.C 2008/01/20 13:45:21 1.395 @@ -28,6 +28,7 @@ * - Ctrl/Mod4+Tab works like Meta+Tab (options) * Copyright (c) 2003 Rob McMullen * Copyright (c) 2003-2007 Marc Lehmann + * Copyright (c) 2007 Emanuele Giaquinta * * 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 @@ -222,7 +223,7 @@ sprintf (buf, "%8x", ch); scr_overlay_set (0, y, buf); scr_overlay_set (9, y, '='); -# if !UNICODE3 +# if !UNICODE_3 if (ch >= 0x10000) ch = 0xfffd; # endif @@ -1080,7 +1081,7 @@ { hidden_text = !hidden_text; want_refresh = 1; - refresh_check (); + refresh_check (); } else w.stop (); @@ -1439,7 +1440,7 @@ break; case ConfigureNotify: - /* fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n", + /*fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n", ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y, szHint.width, szHint.height); */ if (ev.xconfigure.window == parent[0]) @@ -1456,9 +1457,15 @@ { #ifdef HAVE_BG_PIXMAP if (bgPixmap.window_position_sensitive ()) - update_background (); + { + if (mapped) + update_background (); + else + bgPixmap.invalidate (); + } #endif } + HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); } break; @@ -1485,6 +1492,22 @@ break; case MapNotify: +#ifdef HAVE_BG_PIXMAP + /* This is needed spcifically to fix the case of no window manager or a + * non-reparenting window manager. In those cases we never get first + * ConfigureNotify. Also that speeds startup under normal WM, by taking + * care of multiplicity of ConfigureNotify events arriwing while WM does + * reparenting. + * We should not render background immidiately, as there could be several + * ConfigureNotify's to follow. Lets take care of all of them in one scoop + * by scheduling background redraw as soon as we can, but giving a short + * bit of time for ConfigureNotifies to arrive. + * We should render background PRIOR to drawing any text, but AFTER all + * of ConfigureNotifys for the best results. + */ + if (bgPixmap.flags & bgPixmap_t::isInvalid) + update_background_ev.start (0.025); +#endif mapped = 1; #ifdef TEXT_BLINK text_blink_ev.start (); @@ -1530,7 +1553,7 @@ while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event)) ; - if (isScrollbarWindow (ev.xany.window)) + if (scrollBar.state && ev.xany.window == scrollBar.win) { scrollBar.setIdle (); scrollbar_show (0); @@ -1630,7 +1653,7 @@ #endif } } - else if (isScrollbarWindow (ev.xany.window) && scrollbar_isMotion ()) + else if (scrollbar_isMotion () && ev.xany.window == scrollBar.win) { while (XCheckTypedWindowEvent (dpy, scrollBar.win, MotionNotify, &ev)) @@ -1796,6 +1819,7 @@ bgPixmap.set_root_pixmap (); update_background (); } + break; } # endif @@ -1923,7 +1947,7 @@ /* * Scrollbar window processing of button press */ - if (isScrollbarWindow (ev.window)) + if (scrollBar.state && ev.window == scrollBar.win) { scrollBar.setIdle (); /* @@ -2007,7 +2031,7 @@ switch (ev.button) { case Button2: - switch (scrollbar_align) + switch (scrollBar.align) { case R_SB_ALIGN_TOP: csrO = 0; @@ -2029,7 +2053,7 @@ break; case Button1: - if (scrollbar_align == R_SB_ALIGN_CENTRE) + if (scrollBar.align == R_SB_ALIGN_CENTRE) csrO = ev.y - scrollBar.top; /* FALLTHROUGH */ @@ -2169,13 +2193,11 @@ slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); } else - { # endif + { scr_page (v, i); scrollbar_show (1); -# ifdef MOUSE_SLIP_WHEELING } -# endif } break; #endif @@ -2828,6 +2850,7 @@ tt_printf ("\033[>%d;95;0c", 'U'); } break; + case '?': if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') process_terminal_mode (ch, priv, nargs, arg); @@ -3353,9 +3376,11 @@ process_color_seq (op, color, name, resp); } break; + case Rxvt_restoreFG: case XTerm_Color00: process_color_seq (op, Color_fg, str, resp); break; + case Rxvt_restoreBG: case XTerm_Color01: process_color_seq (op, Color_bg, str, resp); break; @@ -3391,10 +3416,12 @@ process_color_seq (op, Color_tint, str, resp); { bool changed = false; + if (ISSET_PIXCOLOR (Color_tint)) changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]); else changed = bgPixmap.unset_tint (); + if (changed) update_background (); } @@ -3427,6 +3454,7 @@ if (str == NULL) bgPixmap.set_defaultGeometry (); } + while (str) { str++; @@ -3434,19 +3462,13 @@ changed++; str = strchr (str, ';'); } + if (changed) - update_background (); + update_background (); } break; #endif - case Rxvt_restoreFG: - set_window_color (Color_fg, str); - break; - case Rxvt_restoreBG: - set_window_color (Color_bg, str); - break; - case XTerm_logfile: // TODO, when secure mode? break; @@ -3667,7 +3689,10 @@ break; case 3: /* 80/132 */ if (priv_modes & PrivMode_132OK) - set_widthheight (((state ? 132 : 80) * fwidth), height); + { + scr_poweron (); + set_widthheight (((state ? 132 : 80) * fwidth), 24 * fheight); + } break; case 4: /* smooth scrolling */ set_option (Opt_jumpScroll, !state);