… | |
… | |
877 | return; |
877 | return; |
878 | |
878 | |
879 | if (len <= 0) |
879 | if (len <= 0) |
880 | return; /* not mapped */ |
880 | return; /* not mapped */ |
881 | |
881 | |
882 | if (OPTION (Opt_scrollTtyKeypress)) |
882 | if (option (Opt_scrollTtyKeypress)) |
883 | if (view_start) |
883 | if (view_start) |
884 | { |
884 | { |
885 | view_start = 0; |
885 | view_start = 0; |
886 | want_refresh = 1; |
886 | want_refresh = 1; |
887 | } |
887 | } |
… | |
… | |
1232 | } |
1232 | } |
1233 | else |
1233 | else |
1234 | { |
1234 | { |
1235 | pty_ev.stop (); |
1235 | pty_ev.stop (); |
1236 | |
1236 | |
1237 | if (!OPTION (Opt_hold)) |
1237 | if (!option (Opt_hold)) |
1238 | destroy (); |
1238 | destroy (); |
1239 | } |
1239 | } |
1240 | |
1240 | |
1241 | return false; |
1241 | return false; |
1242 | } |
1242 | } |
… | |
… | |
1263 | recolour_cursor (); |
1263 | recolour_cursor (); |
1264 | |
1264 | |
1265 | #ifdef POINTER_BLANK |
1265 | #ifdef POINTER_BLANK |
1266 | hidden_pointer = 0; |
1266 | hidden_pointer = 0; |
1267 | |
1267 | |
1268 | if (OPTION (Opt_pointerBlank)) |
1268 | if (option (Opt_pointerBlank)) |
1269 | pointer_ev.start (NOW + pointerBlankDelay); |
1269 | pointer_ev.start (NOW + pointerBlankDelay); |
1270 | #endif |
1270 | #endif |
1271 | } |
1271 | } |
1272 | |
1272 | |
1273 | #ifdef POINTER_BLANK |
1273 | #ifdef POINTER_BLANK |
1274 | void |
1274 | void |
1275 | rxvt_term::pointer_blank () |
1275 | rxvt_term::pointer_blank () |
1276 | { |
1276 | { |
1277 | if (!OPTION (Opt_pointerBlank)) |
1277 | if (!option (Opt_pointerBlank)) |
1278 | return; |
1278 | return; |
1279 | |
1279 | |
1280 | XDefineCursor (dpy, vt, display->blank_cursor); |
1280 | XDefineCursor (dpy, vt, display->blank_cursor); |
1281 | XFlush (dpy); |
1281 | XFlush (dpy); |
1282 | |
1282 | |
… | |
… | |
1458 | break; |
1458 | break; |
1459 | } |
1459 | } |
1460 | break; |
1460 | break; |
1461 | |
1461 | |
1462 | case FocusIn: |
1462 | case FocusIn: |
|
|
1463 | if (ev.xfocus.detail != NotifyInferior |
|
|
1464 | && ev.xfocus.detail != NotifyPointer |
|
|
1465 | && ev.xfocus.mode != NotifyGrab) |
1463 | focus_in (); |
1466 | focus_in (); |
1464 | break; |
1467 | break; |
1465 | |
1468 | |
1466 | case FocusOut: |
1469 | case FocusOut: |
|
|
1470 | if (ev.xfocus.detail != NotifyInferior |
|
|
1471 | && ev.xfocus.detail != NotifyPointer |
|
|
1472 | && ev.xfocus.mode != NotifyGrab) |
1467 | focus_out (); |
1473 | focus_out (); |
1468 | break; |
1474 | break; |
1469 | |
1475 | |
1470 | case ConfigureNotify: |
1476 | case ConfigureNotify: |
1471 | if (ev.xconfigure.window == parent[0]) |
1477 | if (ev.xconfigure.window == parent[0]) |
1472 | { |
1478 | { |
… | |
… | |
1479 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1485 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1480 | } |
1486 | } |
1481 | |
1487 | |
1482 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1488 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1483 | |
1489 | |
1484 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1490 | #ifdef TRANSPARENT |
1485 | if (OPTION (Opt_transparent)) |
1491 | if (option (Opt_transparent)) |
1486 | check_our_parents (); |
1492 | check_our_parents (); |
1487 | #endif |
1493 | #endif |
1488 | } |
1494 | } |
1489 | break; |
1495 | break; |
1490 | |
1496 | |
… | |
… | |
1679 | } |
1685 | } |
1680 | break; |
1686 | break; |
1681 | } |
1687 | } |
1682 | |
1688 | |
1683 | #if defined(CURSOR_BLINK) |
1689 | #if defined(CURSOR_BLINK) |
1684 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1690 | if (option (Opt_cursorBlink) && ev.type == KeyPress) |
1685 | { |
1691 | { |
1686 | if (hidden_cursor) |
1692 | if (hidden_cursor) |
1687 | { |
1693 | { |
1688 | hidden_cursor = 0; |
1694 | hidden_cursor = 0; |
1689 | want_refresh = 1; |
1695 | want_refresh = 1; |
… | |
… | |
1692 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1698 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1693 | } |
1699 | } |
1694 | #endif |
1700 | #endif |
1695 | |
1701 | |
1696 | #if defined(POINTER_BLANK) |
1702 | #if defined(POINTER_BLANK) |
1697 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1703 | if (option (Opt_pointerBlank) && pointerBlankDelay > 0) |
1698 | { |
1704 | { |
1699 | if (ev.type == MotionNotify |
1705 | if (ev.type == MotionNotify |
1700 | || ev.type == ButtonPress |
1706 | || ev.type == ButtonPress |
1701 | || ev.type == ButtonRelease) |
1707 | || ev.type == ButtonRelease) |
1702 | if (hidden_pointer) |
1708 | if (hidden_pointer) |
… | |
… | |
1724 | IMSetPosition (); |
1730 | IMSetPosition (); |
1725 | XSetICFocus (Input_Context); |
1731 | XSetICFocus (Input_Context); |
1726 | } |
1732 | } |
1727 | #endif |
1733 | #endif |
1728 | #if CURSOR_BLINK |
1734 | #if CURSOR_BLINK |
1729 | if (OPTION (Opt_cursorBlink)) |
1735 | if (option (Opt_cursorBlink)) |
1730 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1736 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1731 | #endif |
1737 | #endif |
1732 | #if OFF_FOCUS_FADING |
1738 | #if OFF_FOCUS_FADING |
1733 | if (rs[Rs_fade]) |
1739 | if (rs[Rs_fade]) |
1734 | { |
1740 | { |
… | |
… | |
1761 | #if USE_XIM |
1767 | #if USE_XIM |
1762 | if (Input_Context != NULL) |
1768 | if (Input_Context != NULL) |
1763 | XUnsetICFocus (Input_Context); |
1769 | XUnsetICFocus (Input_Context); |
1764 | #endif |
1770 | #endif |
1765 | #if CURSOR_BLINK |
1771 | #if CURSOR_BLINK |
1766 | if (OPTION (Opt_cursorBlink)) |
1772 | if (option (Opt_cursorBlink)) |
1767 | cursor_blink_ev.stop (); |
1773 | cursor_blink_ev.stop (); |
1768 | hidden_cursor = 0; |
1774 | hidden_cursor = 0; |
1769 | #endif |
1775 | #endif |
1770 | #if OFF_FOCUS_FADING |
1776 | #if OFF_FOCUS_FADING |
1771 | if (rs[Rs_fade]) |
1777 | if (rs[Rs_fade]) |
… | |
… | |
1812 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1818 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1813 | return; |
1819 | return; |
1814 | |
1820 | |
1815 | /* FALLTHROUGH */ |
1821 | /* FALLTHROUGH */ |
1816 | case ReparentNotify: |
1822 | case ReparentNotify: |
1817 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1823 | if (option (Opt_transparent) && check_our_parents () && am_transparent) |
1818 | want_refresh = want_full_refresh = 1; |
1824 | want_refresh = want_full_refresh = 1; |
1819 | break; |
1825 | break; |
1820 | } |
1826 | } |
1821 | # endif |
1827 | # endif |
1822 | } |
1828 | } |
… | |
… | |
2154 | selection_make (ev.time); |
2160 | selection_make (ev.time); |
2155 | break; |
2161 | break; |
2156 | |
2162 | |
2157 | case Button2: |
2163 | case Button2: |
2158 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2164 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2159 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); |
2165 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); |
2160 | break; |
2166 | break; |
2161 | |
2167 | |
2162 | #ifdef MOUSE_WHEEL |
2168 | #ifdef MOUSE_WHEEL |
2163 | case Button4: |
2169 | case Button4: |
2164 | case Button5: |
2170 | case Button5: |
… | |
… | |
2168 | |
2174 | |
2169 | v = ev.button == Button4 ? UP : DN; |
2175 | v = ev.button == Button4 ? UP : DN; |
2170 | |
2176 | |
2171 | if (ev.state & ShiftMask) |
2177 | if (ev.state & ShiftMask) |
2172 | i = 1; |
2178 | i = 1; |
2173 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2179 | else if (option (Opt_mouseWheelScrollPage)) |
2174 | i = nrow - 1; |
2180 | i = nrow - 1; |
2175 | else |
2181 | else |
2176 | i = 5; |
2182 | i = 5; |
2177 | |
2183 | |
2178 | # ifdef MOUSE_SLIP_WHEELING |
2184 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2449 | Pixmap rootpixmap = None; |
2455 | Pixmap rootpixmap = None; |
2450 | XWindowAttributes wattr, wrootattr; |
2456 | XWindowAttributes wattr, wrootattr; |
2451 | |
2457 | |
2452 | pchanged = 0; |
2458 | pchanged = 0; |
2453 | |
2459 | |
2454 | if (!OPTION (Opt_transparent)) |
2460 | if (!option (Opt_transparent)) |
2455 | return pchanged; /* Don't try any more */ |
2461 | return pchanged; /* Don't try any more */ |
2456 | |
2462 | |
2457 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
2463 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
2458 | rootdepth = wrootattr.depth; |
2464 | rootdepth = wrootattr.depth; |
2459 | |
2465 | |
… | |
… | |
2729 | if (ch == C0_LF) |
2735 | if (ch == C0_LF) |
2730 | nlines++; |
2736 | nlines++; |
2731 | |
2737 | |
2732 | refresh_count++; |
2738 | refresh_count++; |
2733 | |
2739 | |
2734 | if (!OPTION (Opt_jumpScroll) |
2740 | if (!option (Opt_jumpScroll) |
2735 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2741 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2736 | { |
2742 | { |
2737 | refreshnow = true; |
2743 | refreshnow = true; |
2738 | refresh_count = 0; |
2744 | refresh_count = 0; |
2739 | ch = NOCHAR; |
2745 | ch = NOCHAR; |
… | |
… | |
2779 | * the number of pages between refreshes is refresh_limit, which |
2785 | * the number of pages between refreshes is refresh_limit, which |
2780 | * is incremented here because we must be doing flat-out scrolling. |
2786 | * is incremented here because we must be doing flat-out scrolling. |
2781 | */ |
2787 | */ |
2782 | if (refreshnow) |
2788 | if (refreshnow) |
2783 | { |
2789 | { |
2784 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2790 | if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2785 | refresh_limit++; |
2791 | refresh_limit++; |
2786 | else |
2792 | else |
2787 | { |
2793 | { |
2788 | flag = true; |
2794 | flag = true; |
2789 | //TODO: due to popular request, implement "skipscroll" option here |
2795 | //TODO: due to popular request, implement "skipscroll" option here |
… | |
… | |
3455 | break; |
3461 | break; |
3456 | case 6: /* CPR requested */ |
3462 | case 6: /* CPR requested */ |
3457 | scr_report_position (); |
3463 | scr_report_position (); |
3458 | break; |
3464 | break; |
3459 | case 7: /* unofficial extension */ |
3465 | case 7: /* unofficial extension */ |
3460 | if (OPTION (Opt_insecure)) |
3466 | if (option (Opt_insecure)) |
3461 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3467 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3462 | break; |
3468 | break; |
3463 | case 8: /* unofficial extension */ |
3469 | case 8: /* unofficial extension */ |
3464 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3470 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3465 | break; |
3471 | break; |
… | |
… | |
3629 | break; |
3635 | break; |
3630 | case 20: /* report icon label */ |
3636 | case 20: /* report icon label */ |
3631 | { |
3637 | { |
3632 | char *s; |
3638 | char *s; |
3633 | XGetIconName (dpy, parent[0], &s); |
3639 | XGetIconName (dpy, parent[0], &s); |
3634 | tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3640 | tt_printf ("\033]L%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3635 | XFree (s); |
3641 | XFree (s); |
3636 | } |
3642 | } |
3637 | break; |
3643 | break; |
3638 | case 21: /* report window title */ |
3644 | case 21: /* report window title */ |
3639 | { |
3645 | { |
3640 | char *s; |
3646 | char *s; |
3641 | XFetchName (dpy, parent[0], &s); |
3647 | XFetchName (dpy, parent[0], &s); |
3642 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3648 | tt_printf ("\033]l%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3643 | XFree (s); |
3649 | XFree (s); |
3644 | } |
3650 | } |
3645 | break; |
3651 | break; |
3646 | } |
3652 | } |
3647 | } |
3653 | } |
… | |
… | |
3955 | case URxvt_italicFont: |
3961 | case URxvt_italicFont: |
3956 | case URxvt_boldItalicFont: |
3962 | case URxvt_boldItalicFont: |
3957 | #endif |
3963 | #endif |
3958 | if (query) |
3964 | if (query) |
3959 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3965 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3960 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3966 | option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3961 | ? fontset[op - URxvt_font]->fontdesc : "", |
3967 | ? fontset[op - URxvt_font]->fontdesc : "", |
3962 | resp); |
3968 | resp); |
3963 | else |
3969 | else |
3964 | { |
3970 | { |
3965 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3971 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3979 | break; |
3985 | break; |
3980 | |
3986 | |
3981 | #if !ENABLE_MINIMAL |
3987 | #if !ENABLE_MINIMAL |
3982 | case URxvt_locale: |
3988 | case URxvt_locale: |
3983 | if (query) |
3989 | if (query) |
3984 | tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); |
3990 | tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); |
3985 | else |
3991 | else |
3986 | { |
3992 | { |
3987 | set_locale (str); |
3993 | set_locale (str); |
3988 | pty->set_utf8_mode (enc_utf8); |
3994 | pty->set_utf8_mode (enc_utf8); |
3989 | init_xlocale (); |
3995 | init_xlocale (); |
… | |
… | |
4130 | scr_touch (true); |
4136 | scr_touch (true); |
4131 | break; |
4137 | break; |
4132 | #endif |
4138 | #endif |
4133 | case 1048: /* alternative cursor save */ |
4139 | case 1048: /* alternative cursor save */ |
4134 | case 1049: |
4140 | case 1049: |
4135 | if (OPTION (Opt_secondaryScreen)) |
4141 | if (option (Opt_secondaryScreen)) |
4136 | if (mode == 0) |
4142 | if (mode == 0) |
4137 | scr_cursor (RESTORE); |
4143 | scr_cursor (RESTORE); |
4138 | else if (mode == 1) |
4144 | else if (mode == 1) |
4139 | scr_cursor (SAVE); |
4145 | scr_cursor (SAVE); |
4140 | break; |
4146 | break; |
… | |
… | |
4205 | break; |
4211 | break; |
4206 | case 1011: /* scroll to bottom on key press */ |
4212 | case 1011: /* scroll to bottom on key press */ |
4207 | set_option (Opt_scrollTtyKeypress, state); |
4213 | set_option (Opt_scrollTtyKeypress, state); |
4208 | break; |
4214 | break; |
4209 | case 1047: /* secondary screen w/ clearing last */ |
4215 | case 1047: /* secondary screen w/ clearing last */ |
4210 | if (OPTION (Opt_secondaryScreen)) |
4216 | if (option (Opt_secondaryScreen)) |
4211 | if (current_screen != PRIMARY) |
4217 | if (current_screen != PRIMARY) |
4212 | scr_erase_screen (2); |
4218 | scr_erase_screen (2); |
4213 | scr_change_screen (state); |
4219 | scr_change_screen (state); |
4214 | break; |
4220 | break; |
4215 | case 1049: /* secondary screen w/ clearing first */ |
4221 | case 1049: /* secondary screen w/ clearing first */ |
4216 | scr_change_screen (state); |
4222 | scr_change_screen (state); |
4217 | if (OPTION (Opt_secondaryScreen)) |
4223 | if (option (Opt_secondaryScreen)) |
4218 | if (current_screen != PRIMARY) |
4224 | if (current_screen != PRIMARY) |
4219 | scr_erase_screen (2); |
4225 | scr_erase_screen (2); |
4220 | break; |
4226 | break; |
4221 | default: |
4227 | default: |
4222 | break; |
4228 | break; |