--- rxvt-unicode/src/command.C 2007/12/11 21:10:46 1.375 +++ rxvt-unicode/src/command.C 2007/12/24 06:51:37 1.385 @@ -27,7 +27,7 @@ * Copyright (c) 2001 Marius Gedminas * - Ctrl/Mod4+Tab works like Meta+Tab (options) * Copyright (c) 2003 Rob McMullen - * 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 @@ -200,7 +200,7 @@ int width = wcswidth (fname, wcslen (fname)); - max_it (width, 8+5); // for char + hey + max_it (width, 8+5); // for char + hex max_it (width, strlen (attr)); if (y >= 0) @@ -1043,15 +1043,14 @@ display->flush (); } +/* checks wether a refresh is requested and starts the refresh timer */ void -rxvt_term::prepare_cb (ev::prepare &w, int revents) +rxvt_term::refresh_check () { - make_current (); + if (want_refresh && !flush_ev.is_active ()) + flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally display->flush (); - - if (want_refresh && !ev_is_active (&flush_ev)) - flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally } void @@ -1069,6 +1068,7 @@ { hidden_cursor = !hidden_cursor; want_refresh = 1; + refresh_check (); } #endif @@ -1080,6 +1080,7 @@ { hidden_text = !hidden_text; want_refresh = 1; + refresh_check (); } else w.stop (); @@ -1090,9 +1091,12 @@ void rxvt_term::cont_scroll_cb (ev::timer &w, int revents) { - if ((scrollbar_isUp() || scrollbar_isDn()) && - scr_page (scrollbar_isUp() ? UP : DN, 1)) - want_refresh = 1; + if ((scrollbar_isUp () || scrollbar_isDn ()) + && scr_page (scrollbar_isUp () ? UP : DN, 1)) + { + want_refresh = 1; + refresh_check (); + } else w.stop (); } @@ -1106,6 +1110,7 @@ { selection_extend (selection_save_x, selection_save_y, selection_save_state); want_refresh = 1; + refresh_check (); } else w.stop (); @@ -1116,17 +1121,17 @@ void rxvt_term::slip_wheel_cb (ev::timer &w, int revents) { - if (mouse_slip_wheel_speed == 0 - || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) - : scr_page (UP, mouse_slip_wheel_speed)) + if (scr_changeview (view_start - mouse_slip_wheel_speed)) { - if (view_start == top_row || view_start == 0) - mouse_slip_wheel_speed = 0; - want_refresh = 1; + refresh_check (); + } + + if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0) + { + mouse_slip_wheel_speed = 0; + w.stop (); } - else - w.stop (); } #endif @@ -1208,6 +1213,8 @@ if (revents & ev::WRITE) pty_write (); + + refresh_check (); } void @@ -1452,6 +1459,7 @@ update_background (); #endif } + HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); } break; @@ -1511,6 +1519,7 @@ scr_expose (ev.xexpose.x, ev.xexpose.y, ev.xexpose.width, ev.xexpose.height, False); } + want_refresh = 1; } else @@ -1581,7 +1590,7 @@ /* don't clobber the current delay if we are * already in the middle of scrolling. */ - if (!ev_is_active (&sel_scroll_ev)) + if (!sel_scroll_ev.is_active ()) sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); /* save the event params so we can highlight @@ -1614,8 +1623,7 @@ /* we are within the text window, so we * shouldn't be scrolling */ - if (ev_is_active (&sel_scroll_ev)) - sel_scroll_ev.stop(); + sel_scroll_ev.stop(); } #endif #ifdef MOUSE_THRESHOLD @@ -1668,6 +1676,8 @@ pointer_blank (); } #endif + + refresh_check (); } void @@ -1787,9 +1797,12 @@ bgPixmap.set_root_pixmap (); update_background (); } + break; } # endif + + refresh_check (); } #endif @@ -1977,10 +1990,12 @@ else if (scrollbarrxvt_dnButton (ev.y)) upordown = 1; /* down */ } + if (upordown) { #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING - cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); + if (!cont_scroll_ev.is_active ()) + cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); #endif if (scr_page (upordown < 0 ? UP : DN, 1)) { @@ -2070,8 +2085,7 @@ } #ifdef SELECTION_SCROLLING - if (ev_is_active (&sel_scroll_ev)) - sel_scroll_ev.stop(); + sel_scroll_ev.stop(); #endif if (ev.window == vt) @@ -2153,7 +2167,8 @@ if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow; - slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); + if (!slip_wheel_ev.is_active ()) + slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); } else { @@ -3378,10 +3393,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 (); } @@ -3414,6 +3431,7 @@ if (str == NULL) bgPixmap.set_defaultGeometry (); } + while (str) { str++; @@ -3421,8 +3439,9 @@ changed++; str = strchr (str, ';'); } + if (changed) - update_background (); + update_background (); } break; #endif