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.376 by root, Fri Dec 14 02:08:18 2007 UTC vs.
Revision 1.381 by root, Fri Dec 14 05:25:23 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.
1041 } 1041 }
1042 1042
1043 display->flush (); 1043 display->flush ();
1044} 1044}
1045 1045
1046/* checks wether a refresh is requested and starts the refresh timer */
1046void 1047void
1047rxvt_term::prepare_cb (ev::prepare &w, int revents) 1048rxvt_term::refresh_check ()
1048{ 1049{
1049 make_current ();
1050
1051 display->flush ();
1052
1053 if (want_refresh && !flush_ev.is_active ()) 1050 if (want_refresh && !flush_ev.is_active ())
1054 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally 1051 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally
1055} 1052}
1056 1053
1057void 1054void
1067void 1064void
1068rxvt_term::cursor_blink_cb (ev::timer &w, int revents) 1065rxvt_term::cursor_blink_cb (ev::timer &w, int revents)
1069{ 1066{
1070 hidden_cursor = !hidden_cursor; 1067 hidden_cursor = !hidden_cursor;
1071 want_refresh = 1; 1068 want_refresh = 1;
1069 refresh_check ();
1072} 1070}
1073#endif 1071#endif
1074 1072
1075#ifdef TEXT_BLINK 1073#ifdef TEXT_BLINK
1076void 1074void
1078{ 1076{
1079 if (scr_refresh_rend (RS_Blink, RS_Blink)) 1077 if (scr_refresh_rend (RS_Blink, RS_Blink))
1080 { 1078 {
1081 hidden_text = !hidden_text; 1079 hidden_text = !hidden_text;
1082 want_refresh = 1; 1080 want_refresh = 1;
1081 refresh_check ();
1083 } 1082 }
1084 else 1083 else
1085 w.stop (); 1084 w.stop ();
1086} 1085}
1087#endif 1086#endif
1088 1087
1089#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1088#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1090void 1089void
1091rxvt_term::cont_scroll_cb (ev::timer &w, int revents) 1090rxvt_term::cont_scroll_cb (ev::timer &w, int revents)
1092{ 1091{
1093 if ((scrollbar_isUp() || scrollbar_isDn()) && 1092 if ((scrollbar_isUp () || scrollbar_isDn ())
1094 scr_page (scrollbar_isUp() ? UP : DN, 1)) 1093 && scr_page (scrollbar_isUp () ? UP : DN, 1))
1094 {
1095 want_refresh = 1; 1095 want_refresh = 1;
1096 refresh_check ();
1097 }
1096 else 1098 else
1097 w.stop (); 1099 w.stop ();
1098} 1100}
1099#endif 1101#endif
1100 1102
1104{ 1106{
1105 if (scr_page (scroll_selection_dir, scroll_selection_lines)) 1107 if (scr_page (scroll_selection_dir, scroll_selection_lines))
1106 { 1108 {
1107 selection_extend (selection_save_x, selection_save_y, selection_save_state); 1109 selection_extend (selection_save_x, selection_save_y, selection_save_state);
1108 want_refresh = 1; 1110 want_refresh = 1;
1111 refresh_check ();
1109 } 1112 }
1110 else 1113 else
1111 w.stop (); 1114 w.stop ();
1112} 1115}
1113#endif 1116#endif
1114 1117
1115#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1118#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1116void 1119void
1117rxvt_term::slip_wheel_cb (ev::timer &w, int revents) 1120rxvt_term::slip_wheel_cb (ev::timer &w, int revents)
1118{ 1121{
1119 if (mouse_slip_wheel_speed == 0 1122 if (scr_changeview (view_start - mouse_slip_wheel_speed))
1120 || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed)
1121 : scr_page (UP, mouse_slip_wheel_speed))
1122 { 1123 {
1123 if (view_start == top_row || view_start == 0)
1124 mouse_slip_wheel_speed = 0;
1125
1126 want_refresh = 1; 1124 want_refresh = 1;
1125 refresh_check ();
1126 }
1127
1128 if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0)
1127 } 1129 {
1128 else 1130 mouse_slip_wheel_speed = 0;
1129 w.stop (); 1131 w.stop ();
1132 }
1130} 1133}
1131#endif 1134#endif
1132 1135
1133#if LINUX_YIELD_HACK 1136#if LINUX_YIELD_HACK
1134static struct event_handler 1137static struct event_handler
1509 while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)) 1512 while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev))
1510 { 1513 {
1511 scr_expose (ev.xexpose.x, ev.xexpose.y, 1514 scr_expose (ev.xexpose.x, ev.xexpose.y,
1512 ev.xexpose.width, ev.xexpose.height, False); 1515 ev.xexpose.width, ev.xexpose.height, False);
1513 } 1516 }
1517
1514 want_refresh = 1; 1518 want_refresh = 1;
1515 } 1519 }
1516 else 1520 else
1517 { 1521 {
1518 XEvent unused_event; 1522 XEvent unused_event;
1665 1669
1666 if (ev.type == KeyPress && hidden_pointer == 0) 1670 if (ev.type == KeyPress && hidden_pointer == 0)
1667 pointer_blank (); 1671 pointer_blank ();
1668 } 1672 }
1669#endif 1673#endif
1674
1675 refresh_check ();
1670} 1676}
1671 1677
1672void 1678void
1673rxvt_term::focus_in () 1679rxvt_term::focus_in ()
1674{ 1680{
1787 update_background (); 1793 update_background ();
1788 } 1794 }
1789 break; 1795 break;
1790 } 1796 }
1791# endif 1797# endif
1798
1799 refresh_check ();
1792} 1800}
1793#endif 1801#endif
1794 1802
1795void 1803void
1796rxvt_term::button_press (XButtonEvent &ev) 1804rxvt_term::button_press (XButtonEvent &ev)
2300 } 2308 }
2301 2309
2302 ch = NOCHAR; 2310 ch = NOCHAR;
2303 } 2311 }
2304 } 2312 }
2313
2314 refresh_check ();
2305 2315
2306 return flag; 2316 return flag;
2307} 2317}
2308 2318
2309// read the next character 2319// read the next character

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines