ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.375 by root, Tue Dec 11 21:10:46 2007 UTC vs.
Revision 1.379 by root, Fri Dec 14 02:29:48 2007 UTC

25 * - extensive modifications 25 * - extensive modifications
26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> 26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org>
27 * Copyright (c) 2001 Marius Gedminas 27 * Copyright (c) 2001 Marius Gedminas
28 * - Ctrl/Mod4+Tab works like Meta+Tab (options) 28 * - Ctrl/Mod4+Tab works like Meta+Tab (options)
29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> 29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org>
30 * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> 30 * Copyright (c) 2003-2007 Marc Lehmann <pcg@goof.com>
31 * 31 *
32 * This program is free software; you can redistribute it and/or modify 32 * This program is free software; you can redistribute it and/or modify
33 * it under the terms of the GNU General Public License as published by 33 * it under the terms of the GNU General Public License as published by
34 * the Free Software Foundation; either version 2 of the License, or 34 * the Free Software Foundation; either version 2 of the License, or
35 * (at your option) any later version. 35 * (at your option) any later version.
1048{ 1048{
1049 make_current (); 1049 make_current ();
1050 1050
1051 display->flush (); 1051 display->flush ();
1052 1052
1053 if (want_refresh && !ev_is_active (&flush_ev)) 1053 if (want_refresh && !flush_ev.is_active ())
1054 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally 1054 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally
1055} 1055}
1056 1056
1057void 1057void
1058rxvt_term::flush_cb (ev::timer &w, int revents) 1058rxvt_term::flush_cb (ev::timer &w, int revents)
1114 1114
1115#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1115#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1116void 1116void
1117rxvt_term::slip_wheel_cb (ev::timer &w, int revents) 1117rxvt_term::slip_wheel_cb (ev::timer &w, int revents)
1118{ 1118{
1119 if (mouse_slip_wheel_speed == 0 1119 if (scr_page (mouse_slip_wheel_speed < 0 ? DN : UP, abs (mouse_slip_wheel_speed)))
1120 || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) 1120 want_refresh = 1;
1121 : scr_page (UP, mouse_slip_wheel_speed)) 1121
1122 if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0)
1122 { 1123 {
1123 if (view_start == top_row || view_start == 0)
1124 mouse_slip_wheel_speed = 0; 1124 mouse_slip_wheel_speed = 0;
1125
1126 want_refresh = 1;
1127 }
1128 else
1129 w.stop (); 1125 w.stop ();
1126 }
1130} 1127}
1131#endif 1128#endif
1132 1129
1133#if LINUX_YIELD_HACK 1130#if LINUX_YIELD_HACK
1134static struct event_handler 1131static struct event_handler
1579 int dist; 1576 int dist;
1580 1577
1581 /* don't clobber the current delay if we are 1578 /* don't clobber the current delay if we are
1582 * already in the middle of scrolling. 1579 * already in the middle of scrolling.
1583 */ 1580 */
1584 if (!ev_is_active (&sel_scroll_ev)) 1581 if (!sel_scroll_ev.is_active ())
1585 sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 1582 sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
1586 1583
1587 /* save the event params so we can highlight 1584 /* save the event params so we can highlight
1588 * the selection in the pending-scroll loop 1585 * the selection in the pending-scroll loop
1589 */ 1586 */
1612 else 1609 else
1613 { 1610 {
1614 /* we are within the text window, so we 1611 /* we are within the text window, so we
1615 * shouldn't be scrolling 1612 * shouldn't be scrolling
1616 */ 1613 */
1617 if (ev_is_active (&sel_scroll_ev))
1618 sel_scroll_ev.stop(); 1614 sel_scroll_ev.stop();
1619 } 1615 }
1620#endif 1616#endif
1621#ifdef MOUSE_THRESHOLD 1617#ifdef MOUSE_THRESHOLD
1622 } 1618 }
1623#endif 1619#endif
1975 if (scrollbarrxvt_upButton (ev.y)) 1971 if (scrollbarrxvt_upButton (ev.y))
1976 upordown = -1; /* up */ 1972 upordown = -1; /* up */
1977 else if (scrollbarrxvt_dnButton (ev.y)) 1973 else if (scrollbarrxvt_dnButton (ev.y))
1978 upordown = 1; /* down */ 1974 upordown = 1; /* down */
1979 } 1975 }
1976
1980 if (upordown) 1977 if (upordown)
1981 { 1978 {
1982#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1979#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1980 if (!cont_scroll_ev.is_active ())
1983 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 1981 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
1984#endif 1982#endif
1985 if (scr_page (upordown < 0 ? UP : DN, 1)) 1983 if (scr_page (upordown < 0 ? UP : DN, 1))
1986 { 1984 {
1987 if (upordown < 0) 1985 if (upordown < 0)
1988 scrollBar.setUp (); 1986 scrollBar.setUp ();
2068 scrollBar.setIdle (); 2066 scrollBar.setIdle ();
2069 scrollbar_show (0); 2067 scrollbar_show (0);
2070 } 2068 }
2071 2069
2072#ifdef SELECTION_SCROLLING 2070#ifdef SELECTION_SCROLLING
2073 if (ev_is_active (&sel_scroll_ev))
2074 sel_scroll_ev.stop(); 2071 sel_scroll_ev.stop();
2075#endif 2072#endif
2076 2073
2077 if (ev.window == vt) 2074 if (ev.window == vt)
2078 { 2075 {
2079 if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) 2076 if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END)))
2151 { 2148 {
2152 mouse_slip_wheel_speed += v ? -1 : 1; 2149 mouse_slip_wheel_speed += v ? -1 : 1;
2153 if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; 2150 if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow;
2154 if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow; 2151 if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow;
2155 2152
2153 if (!slip_wheel_ev.is_active ())
2156 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2154 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2157 } 2155 }
2158 else 2156 else
2159 { 2157 {
2160# endif 2158# endif
2161 scr_page (v, i); 2159 scr_page (v, i);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines