… | |
… | |
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 */ |
1046 | void |
1047 | void |
1047 | rxvt_term::prepare_cb (ev::prepare &w, int revents) |
1048 | rxvt_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 | |
1057 | void |
1054 | void |
… | |
… | |
1067 | void |
1064 | void |
1068 | rxvt_term::cursor_blink_cb (ev::timer &w, int revents) |
1065 | rxvt_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 |
1076 | void |
1074 | void |
… | |
… | |
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 |
1090 | void |
1089 | void |
1091 | rxvt_term::cont_scroll_cb (ev::timer &w, int revents) |
1090 | rxvt_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) |
1116 | void |
1119 | void |
1117 | rxvt_term::slip_wheel_cb (ev::timer &w, int revents) |
1120 | rxvt_term::slip_wheel_cb (ev::timer &w, int revents) |
1118 | { |
1121 | { |
1119 | if (scr_page (mouse_slip_wheel_speed < 0 ? DN : UP, abs (mouse_slip_wheel_speed))) |
1122 | if (scr_changeview (view_start - mouse_slip_wheel_speed)) |
|
|
1123 | { |
1120 | want_refresh = 1; |
1124 | want_refresh = 1; |
|
|
1125 | refresh_check (); |
|
|
1126 | } |
1121 | |
1127 | |
1122 | if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0) |
1128 | if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0) |
1123 | { |
1129 | { |
1124 | mouse_slip_wheel_speed = 0; |
1130 | mouse_slip_wheel_speed = 0; |
1125 | w.stop (); |
1131 | w.stop (); |
… | |
… | |
1506 | while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)) |
1512 | while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)) |
1507 | { |
1513 | { |
1508 | scr_expose (ev.xexpose.x, ev.xexpose.y, |
1514 | scr_expose (ev.xexpose.x, ev.xexpose.y, |
1509 | ev.xexpose.width, ev.xexpose.height, False); |
1515 | ev.xexpose.width, ev.xexpose.height, False); |
1510 | } |
1516 | } |
|
|
1517 | |
1511 | want_refresh = 1; |
1518 | want_refresh = 1; |
1512 | } |
1519 | } |
1513 | else |
1520 | else |
1514 | { |
1521 | { |
1515 | XEvent unused_event; |
1522 | XEvent unused_event; |
… | |
… | |
1662 | |
1669 | |
1663 | if (ev.type == KeyPress && hidden_pointer == 0) |
1670 | if (ev.type == KeyPress && hidden_pointer == 0) |
1664 | pointer_blank (); |
1671 | pointer_blank (); |
1665 | } |
1672 | } |
1666 | #endif |
1673 | #endif |
|
|
1674 | |
|
|
1675 | refresh_check (); |
1667 | } |
1676 | } |
1668 | |
1677 | |
1669 | void |
1678 | void |
1670 | rxvt_term::focus_in () |
1679 | rxvt_term::focus_in () |
1671 | { |
1680 | { |
… | |
… | |
1784 | update_background (); |
1793 | update_background (); |
1785 | } |
1794 | } |
1786 | break; |
1795 | break; |
1787 | } |
1796 | } |
1788 | # endif |
1797 | # endif |
|
|
1798 | |
|
|
1799 | refresh_check (); |
1789 | } |
1800 | } |
1790 | #endif |
1801 | #endif |
1791 | |
1802 | |
1792 | void |
1803 | void |
1793 | rxvt_term::button_press (XButtonEvent &ev) |
1804 | rxvt_term::button_press (XButtonEvent &ev) |
… | |
… | |
2297 | } |
2308 | } |
2298 | |
2309 | |
2299 | ch = NOCHAR; |
2310 | ch = NOCHAR; |
2300 | } |
2311 | } |
2301 | } |
2312 | } |
|
|
2313 | |
|
|
2314 | refresh_check (); |
2302 | |
2315 | |
2303 | return flag; |
2316 | return flag; |
2304 | } |
2317 | } |
2305 | |
2318 | |
2306 | // read the next character |
2319 | // read the next character |