--- rxvt-unicode/src/command.C 2007/12/11 18:00:06 1.374 +++ rxvt-unicode/src/command.C 2007/12/14 02:33:03 1.380 @@ -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 @@ -1050,7 +1050,7 @@ display->flush (); - if (want_refresh && !ev_is_active (&flush_ev)) + if (want_refresh && !flush_ev.is_active ()) flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally } @@ -1081,6 +1081,8 @@ hidden_text = !hidden_text; want_refresh = 1; } + else + w.stop (); } #endif @@ -1088,8 +1090,8 @@ void rxvt_term::cont_scroll_cb (ev::timer &w, int revents) { - if ((scrollbar_isUp() || scrollbar_isDn()) && - scr_page (scrollbar_isUp() ? UP : DN, 1)) + if ((scrollbar_isUp () || scrollbar_isDn ()) + && scr_page (scrollbar_isUp () ? UP : DN, 1)) want_refresh = 1; else w.stop (); @@ -1114,17 +1116,14 @@ 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 (view_start == top_row || view_start == 0) - mouse_slip_wheel_speed = 0; + if (scr_changeview (view_start - mouse_slip_wheel_speed)) + want_refresh = 1; - want_refresh = 1; + if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0) + { + mouse_slip_wheel_speed = 0; + w.stop (); } - else - w.stop (); } #endif @@ -1579,7 +1578,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 @@ -1612,8 +1611,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 @@ -1687,7 +1685,7 @@ #endif #if CURSOR_BLINK if (option (Opt_cursorBlink)) - cursor_blink_ev.start (CURSOR_BLINK_INTERVAL, CURSOR_BLINK_INTERVAL); + cursor_blink_ev.again (); #endif #if OFF_FOCUS_FADING if (rs[Rs_fade]) @@ -1975,10 +1973,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)) { @@ -2068,8 +2068,7 @@ } #ifdef SELECTION_SCROLLING - if (ev_is_active (&sel_scroll_ev)) - sel_scroll_ev.stop(); + sel_scroll_ev.stop(); #endif if (ev.window == vt) @@ -2151,7 +2150,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 {