… | |
… | |
510 | #endif |
510 | #endif |
511 | max_it (lnsppg, 1); |
511 | max_it (lnsppg, 1); |
512 | |
512 | |
513 | if (keysym == XK_Prior) |
513 | if (keysym == XK_Prior) |
514 | { |
514 | { |
515 | scr_page (UP, lnsppg); |
515 | scr_page (lnsppg); |
516 | return; |
516 | return; |
517 | } |
517 | } |
518 | else if (keysym == XK_Next) |
518 | else if (keysym == XK_Next) |
519 | { |
519 | { |
520 | scr_page (DN, lnsppg); |
520 | scr_page (-lnsppg); |
521 | return; |
521 | return; |
522 | } |
522 | } |
523 | } |
523 | } |
524 | #ifdef SCROLL_ON_UPDOWN_KEYS |
524 | #ifdef SCROLL_ON_UPDOWN_KEYS |
525 | if (IS_SCROLL_MOD) |
525 | if (IS_SCROLL_MOD) |
526 | { |
526 | { |
527 | if (keysym == XK_Up) |
527 | if (keysym == XK_Up) |
528 | { |
528 | { |
529 | scr_page (UP, 1); |
529 | scr_page (1); |
530 | return; |
530 | return; |
531 | } |
531 | } |
532 | else if (keysym == XK_Down) |
532 | else if (keysym == XK_Down) |
533 | { |
533 | { |
534 | scr_page (DN, 1); |
534 | scr_page (-1); |
535 | return; |
535 | return; |
536 | } |
536 | } |
537 | } |
537 | } |
538 | #endif |
538 | #endif |
539 | #ifdef SCROLL_ON_HOMEEND_KEYS |
539 | #ifdef SCROLL_ON_HOMEEND_KEYS |
540 | if (IS_SCROLL_MOD) |
540 | if (IS_SCROLL_MOD) |
541 | { |
541 | { |
542 | if (keysym == XK_Home) |
542 | if (keysym == XK_Home) |
543 | { |
543 | { |
544 | scr_move_to (0, 1); |
544 | scr_changeview (top_row); |
545 | return; |
545 | return; |
546 | } |
546 | } |
547 | else if (keysym == XK_End) |
547 | else if (keysym == XK_End) |
548 | { |
548 | { |
549 | scr_move_to (1, 1); |
549 | scr_changeview (0); |
550 | return; |
550 | return; |
551 | } |
551 | } |
552 | } |
552 | } |
553 | #endif |
553 | #endif |
554 | } |
554 | } |
… | |
… | |
1092 | |
1092 | |
1093 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
1093 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
1094 | void |
1094 | void |
1095 | rxvt_term::slip_wheel_cb (ev::timer &w, int revents) |
1095 | rxvt_term::slip_wheel_cb (ev::timer &w, int revents) |
1096 | { |
1096 | { |
1097 | if (scr_changeview (view_start - mouse_slip_wheel_speed)) |
1097 | if (scr_page (mouse_slip_wheel_speed)) |
1098 | { |
1098 | { |
1099 | want_refresh = 1; |
1099 | want_refresh = 1; |
1100 | refresh_check (); |
1100 | refresh_check (); |
1101 | } |
1101 | } |
1102 | |
1102 | |
… | |
… | |
1472 | bool moved = false; |
1472 | bool moved = false; |
1473 | #ifdef HAVE_BG_PIXMAP |
1473 | #ifdef HAVE_BG_PIXMAP |
1474 | if (bg_window_position_sensitive ()) |
1474 | if (bg_window_position_sensitive ()) |
1475 | { |
1475 | { |
1476 | want_position_change = true; |
1476 | want_position_change = true; |
1477 | if (!(bg_flags & BG_IS_VALID)) |
1477 | if (bg_img == 0) |
1478 | moved = true; |
1478 | moved = true; |
1479 | } |
1479 | } |
1480 | #endif |
1480 | #endif |
1481 | |
1481 | |
1482 | if (want_position_change) |
1482 | if (want_position_change) |
… | |
… | |
1536 | // defer bg image updates if the window is not mapped. The |
1536 | // defer bg image updates if the window is not mapped. The |
1537 | // short delay is to optimize for multiple ConfigureNotify |
1537 | // short delay is to optimize for multiple ConfigureNotify |
1538 | // events at startup when the window manager reparents the |
1538 | // events at startup when the window manager reparents the |
1539 | // window, so as to perform the computation after we have |
1539 | // window, so as to perform the computation after we have |
1540 | // received all of them. |
1540 | // received all of them. |
1541 | if (!(bg_flags & BG_IS_VALID)) |
1541 | if (bg_img == 0) |
1542 | update_background_ev.start (0.025); |
1542 | update_background_ev.start (0.025); |
1543 | #endif |
1543 | #endif |
1544 | mapped = 1; |
1544 | mapped = 1; |
1545 | #ifdef TEXT_BLINK |
1545 | #ifdef TEXT_BLINK |
1546 | text_blink_ev.start (); |
1546 | text_blink_ev.start (); |
… | |
… | |
1854 | */ |
1854 | */ |
1855 | if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID] |
1855 | if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID] |
1856 | || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) |
1856 | || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) |
1857 | { |
1857 | { |
1858 | #if BG_IMAGE_FROM_ROOT |
1858 | #if BG_IMAGE_FROM_ROOT |
1859 | bg_set_root_pixmap (); |
1859 | if (option (Opt_transparent)) |
|
|
1860 | { |
|
|
1861 | rxvt_img::new_from_root (this)->replace (root_img); |
1860 | update_background (); |
1862 | update_background (); |
|
|
1863 | } |
1861 | #endif |
1864 | #endif |
1862 | #if ENABLE_PERL |
|
|
1863 | HOOK_INVOKE ((this, HOOK_ROOTPMAP_CHANGE, DT_END)); |
1865 | HOOK_INVOKE ((this, HOOK_ROOTPMAP_CHANGE, DT_END)); |
1864 | #endif |
|
|
1865 | } |
1866 | } |
1866 | |
1867 | |
1867 | break; |
1868 | break; |
1868 | } |
1869 | } |
1869 | |
1870 | |
… | |
… | |
2194 | |
2195 | |
2195 | #ifdef MOUSE_WHEEL |
2196 | #ifdef MOUSE_WHEEL |
2196 | case Button4: |
2197 | case Button4: |
2197 | case Button5: |
2198 | case Button5: |
2198 | { |
2199 | { |
2199 | int i; |
2200 | int lines; |
2200 | page_dirn v; |
2201 | page_dirn dirn; |
2201 | |
2202 | |
2202 | v = ev.button == Button4 ? UP : DN; |
2203 | dirn = ev.button == Button4 ? UP : DN; |
2203 | |
2204 | |
2204 | if (ev.state & ShiftMask) |
2205 | if (ev.state & ShiftMask) |
2205 | i = 1; |
2206 | lines = 1; |
2206 | else if (option (Opt_mouseWheelScrollPage)) |
2207 | else if (option (Opt_mouseWheelScrollPage)) |
2207 | i = nrow - 1; |
2208 | lines = nrow - 1; |
2208 | else |
2209 | else |
2209 | i = 5; |
2210 | lines = 5; |
2210 | |
2211 | |
2211 | # ifdef MOUSE_SLIP_WHEELING |
2212 | # ifdef MOUSE_SLIP_WHEELING |
2212 | if (ev.state & ControlMask) |
2213 | if (ev.state & ControlMask) |
2213 | { |
2214 | { |
2214 | mouse_slip_wheel_speed += v ? -1 : 1; |
2215 | mouse_slip_wheel_speed += dirn; |
2215 | if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; |
2216 | clamp_it (mouse_slip_wheel_speed, -nrow, nrow); |
2216 | if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow; |
|
|
2217 | |
2217 | |
2218 | if (!slip_wheel_ev.is_active ()) |
2218 | if (!slip_wheel_ev.is_active ()) |
2219 | slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); |
2219 | slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); |
2220 | } |
2220 | } |
2221 | else |
2221 | else |
2222 | # endif |
2222 | # endif |
2223 | { |
2223 | { |
2224 | scr_page (v, i); |
2224 | scr_page (dirn, lines); |
2225 | scrollBar.show (1); |
2225 | scrollBar.show (1); |
2226 | } |
2226 | } |
2227 | } |
2227 | } |
2228 | break; |
2228 | break; |
2229 | #endif |
2229 | #endif |
… | |
… | |
2798 | }; |
2798 | }; |
2799 | |
2799 | |
2800 | void ecb_hot |
2800 | void ecb_hot |
2801 | rxvt_term::process_csi_seq () |
2801 | rxvt_term::process_csi_seq () |
2802 | { |
2802 | { |
2803 | unicode_t ch, priv, i; |
2803 | unicode_t ch, priv, prev_ch, i; |
2804 | unsigned int nargs, p; |
2804 | unsigned int nargs, p; |
2805 | int n, ndef; |
2805 | int n, ndef; |
2806 | int arg[ESC_ARGS] = { }; |
2806 | int arg[ESC_ARGS] = { }; |
2807 | |
2807 | |
2808 | nargs = 0; |
2808 | nargs = 0; |
… | |
… | |
2814 | /* '<' '=' '>' '?' '!' */ |
2814 | /* '<' '=' '>' '?' '!' */ |
2815 | priv = ch; |
2815 | priv = ch; |
2816 | ch = cmd_getc (); |
2816 | ch = cmd_getc (); |
2817 | } |
2817 | } |
2818 | |
2818 | |
|
|
2819 | prev_ch = 0; |
2819 | /* read any numerical arguments */ |
2820 | /* read any numerical arguments */ |
2820 | for (n = -1; ch < CSI_ICH; ) |
2821 | for (n = -1; ch < CSI_ICH; ) |
2821 | { |
2822 | { |
2822 | if (isdigit (ch)) |
2823 | if (isdigit (ch)) |
2823 | { |
2824 | { |
… | |
… | |
2833 | n = -1; |
2834 | n = -1; |
2834 | } |
2835 | } |
2835 | else if (IS_CONTROL (ch)) |
2836 | else if (IS_CONTROL (ch)) |
2836 | process_nonprinting (ch); |
2837 | process_nonprinting (ch); |
2837 | |
2838 | |
|
|
2839 | prev_ch = ch; |
2838 | ch = cmd_getc (); |
2840 | ch = cmd_getc (); |
2839 | } |
2841 | } |
2840 | |
2842 | |
2841 | if (ch > CSI_7F) |
2843 | if (ch > CSI_7F) |
2842 | return; |
2844 | return; |
… | |
… | |
3074 | case CSI_SM: /* 8.3.126: SET MODE */ |
3076 | case CSI_SM: /* 8.3.126: SET MODE */ |
3075 | if (arg[0] == 4) |
3077 | if (arg[0] == 4) |
3076 | scr_insert_mode (1); |
3078 | scr_insert_mode (1); |
3077 | else if (arg[0] == 20) |
3079 | else if (arg[0] == 20) |
3078 | priv_modes |= PrivMode_LFNL; |
3080 | priv_modes |= PrivMode_LFNL; |
|
|
3081 | break; |
|
|
3082 | |
|
|
3083 | case CSI_71: // DESCUSR: set cursor style |
|
|
3084 | if (prev_ch == ' ') |
|
|
3085 | set_cursor_style (arg[0]); |
3079 | break; |
3086 | break; |
3080 | |
3087 | |
3081 | /* |
3088 | /* |
3082 | * PRIVATE USE beyond this point. All CSI_7? sequences here |
3089 | * PRIVATE USE beyond this point. All CSI_7? sequences here |
3083 | */ |
3090 | */ |
… | |
… | |
3990 | break; |
3997 | break; |
3991 | #endif |
3998 | #endif |
3992 | } |
3999 | } |
3993 | } |
4000 | } |
3994 | } |
4001 | } |
|
|
4002 | |
|
|
4003 | void |
|
|
4004 | rxvt_term::set_cursor_style (int style) |
|
|
4005 | { |
|
|
4006 | if (!IN_RANGE_INC (style, 0, 4)) |
|
|
4007 | return; |
|
|
4008 | |
|
|
4009 | set_option (Opt_cursorUnderline, style >= 3); |
|
|
4010 | |
|
|
4011 | #ifdef CURSOR_BLINK |
|
|
4012 | set_option (Opt_cursorBlink, !style || (style & 1)); |
|
|
4013 | cursor_blink_reset (); |
|
|
4014 | #endif |
|
|
4015 | |
|
|
4016 | want_refresh = 1; |
|
|
4017 | } |
3995 | /*}}} */ |
4018 | /*}}} */ |
3996 | |
4019 | |
3997 | /* ------------------------------------------------------------------------- */ |
4020 | /* ------------------------------------------------------------------------- */ |
3998 | |
4021 | |
3999 | /* |
4022 | /* |