… | |
… | |
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 && ev.xfocus.detail != NotifyPointer) |
1463 | if (ev.xfocus.detail != NotifyInferior |
|
|
1464 | && ev.xfocus.detail != NotifyPointer |
|
|
1465 | && ev.xfocus.mode != NotifyGrab) |
1464 | focus_in (); |
1466 | focus_in (); |
1465 | break; |
1467 | break; |
1466 | |
1468 | |
1467 | case FocusOut: |
1469 | case FocusOut: |
1468 | if (ev.xfocus.detail != NotifyInferior && ev.xfocus.detail != NotifyPointer) |
1470 | if (ev.xfocus.detail != NotifyInferior |
|
|
1471 | && ev.xfocus.detail != NotifyPointer |
|
|
1472 | && ev.xfocus.mode != NotifyGrab) |
1469 | focus_out (); |
1473 | focus_out (); |
1470 | break; |
1474 | break; |
1471 | |
1475 | |
1472 | case ConfigureNotify: |
1476 | case ConfigureNotify: |
1473 | if (ev.xconfigure.window == parent[0]) |
1477 | if (ev.xconfigure.window == parent[0]) |
… | |
… | |
1481 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1485 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1482 | } |
1486 | } |
1483 | |
1487 | |
1484 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1488 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1485 | |
1489 | |
1486 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1490 | #ifdef TRANSPARENT |
1487 | #if 0 |
|
|
1488 | if (OPTION (Opt_transparent)) |
1491 | if (option (Opt_transparent)) |
1489 | check_our_parents (); |
1492 | check_our_parents (); |
1490 | #endif |
|
|
1491 | #endif |
1493 | #endif |
1492 | } |
1494 | } |
1493 | break; |
1495 | break; |
1494 | |
1496 | |
1495 | case PropertyNotify: |
1497 | case PropertyNotify: |
… | |
… | |
1683 | } |
1685 | } |
1684 | break; |
1686 | break; |
1685 | } |
1687 | } |
1686 | |
1688 | |
1687 | #if defined(CURSOR_BLINK) |
1689 | #if defined(CURSOR_BLINK) |
1688 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1690 | if (option (Opt_cursorBlink) && ev.type == KeyPress) |
1689 | { |
1691 | { |
1690 | if (hidden_cursor) |
1692 | if (hidden_cursor) |
1691 | { |
1693 | { |
1692 | hidden_cursor = 0; |
1694 | hidden_cursor = 0; |
1693 | want_refresh = 1; |
1695 | want_refresh = 1; |
… | |
… | |
1696 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1698 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1697 | } |
1699 | } |
1698 | #endif |
1700 | #endif |
1699 | |
1701 | |
1700 | #if defined(POINTER_BLANK) |
1702 | #if defined(POINTER_BLANK) |
1701 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1703 | if (option (Opt_pointerBlank) && pointerBlankDelay > 0) |
1702 | { |
1704 | { |
1703 | if (ev.type == MotionNotify |
1705 | if (ev.type == MotionNotify |
1704 | || ev.type == ButtonPress |
1706 | || ev.type == ButtonPress |
1705 | || ev.type == ButtonRelease) |
1707 | || ev.type == ButtonRelease) |
1706 | if (hidden_pointer) |
1708 | if (hidden_pointer) |
… | |
… | |
1728 | IMSetPosition (); |
1730 | IMSetPosition (); |
1729 | XSetICFocus (Input_Context); |
1731 | XSetICFocus (Input_Context); |
1730 | } |
1732 | } |
1731 | #endif |
1733 | #endif |
1732 | #if CURSOR_BLINK |
1734 | #if CURSOR_BLINK |
1733 | if (OPTION (Opt_cursorBlink)) |
1735 | if (option (Opt_cursorBlink)) |
1734 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1736 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1735 | #endif |
1737 | #endif |
1736 | #if OFF_FOCUS_FADING |
1738 | #if OFF_FOCUS_FADING |
1737 | if (rs[Rs_fade]) |
1739 | if (rs[Rs_fade]) |
1738 | { |
1740 | { |
1739 | pix_colors = pix_colors_focused; |
1741 | pix_colors = pix_colors_focused; |
1740 | scr_recolour (); |
1742 | scr_recolour (); |
|
|
1743 | } |
|
|
1744 | #endif |
|
|
1745 | #if ENABLE_FRILLS |
|
|
1746 | if (option (Opt_urgentOnBell)) |
|
|
1747 | { |
|
|
1748 | XWMHints *h; |
|
|
1749 | |
|
|
1750 | h = XGetWMHints(dpy, parent[0]); |
|
|
1751 | if (h != NULL) |
|
|
1752 | { |
|
|
1753 | h->flags &= ~XUrgencyHint; |
|
|
1754 | XSetWMHints(dpy, parent[0], h); |
|
|
1755 | } |
1741 | } |
1756 | } |
1742 | #endif |
1757 | #endif |
1743 | } |
1758 | } |
1744 | } |
1759 | } |
1745 | |
1760 | |
… | |
… | |
1765 | #if USE_XIM |
1780 | #if USE_XIM |
1766 | if (Input_Context != NULL) |
1781 | if (Input_Context != NULL) |
1767 | XUnsetICFocus (Input_Context); |
1782 | XUnsetICFocus (Input_Context); |
1768 | #endif |
1783 | #endif |
1769 | #if CURSOR_BLINK |
1784 | #if CURSOR_BLINK |
1770 | if (OPTION (Opt_cursorBlink)) |
1785 | if (option (Opt_cursorBlink)) |
1771 | cursor_blink_ev.stop (); |
1786 | cursor_blink_ev.stop (); |
1772 | hidden_cursor = 0; |
1787 | hidden_cursor = 0; |
1773 | #endif |
1788 | #endif |
1774 | #if OFF_FOCUS_FADING |
1789 | #if OFF_FOCUS_FADING |
1775 | if (rs[Rs_fade]) |
1790 | if (rs[Rs_fade]) |
… | |
… | |
1816 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1831 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1817 | return; |
1832 | return; |
1818 | |
1833 | |
1819 | /* FALLTHROUGH */ |
1834 | /* FALLTHROUGH */ |
1820 | case ReparentNotify: |
1835 | case ReparentNotify: |
1821 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1836 | if (option (Opt_transparent) && check_our_parents () && am_transparent) |
1822 | want_refresh = want_full_refresh = 1; |
1837 | want_refresh = want_full_refresh = 1; |
1823 | break; |
1838 | break; |
1824 | } |
1839 | } |
1825 | # endif |
1840 | # endif |
1826 | } |
1841 | } |
… | |
… | |
2158 | selection_make (ev.time); |
2173 | selection_make (ev.time); |
2159 | break; |
2174 | break; |
2160 | |
2175 | |
2161 | case Button2: |
2176 | case Button2: |
2162 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2177 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2163 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); |
2178 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); |
2164 | break; |
2179 | break; |
2165 | |
2180 | |
2166 | #ifdef MOUSE_WHEEL |
2181 | #ifdef MOUSE_WHEEL |
2167 | case Button4: |
2182 | case Button4: |
2168 | case Button5: |
2183 | case Button5: |
… | |
… | |
2172 | |
2187 | |
2173 | v = ev.button == Button4 ? UP : DN; |
2188 | v = ev.button == Button4 ? UP : DN; |
2174 | |
2189 | |
2175 | if (ev.state & ShiftMask) |
2190 | if (ev.state & ShiftMask) |
2176 | i = 1; |
2191 | i = 1; |
2177 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2192 | else if (option (Opt_mouseWheelScrollPage)) |
2178 | i = nrow - 1; |
2193 | i = nrow - 1; |
2179 | else |
2194 | else |
2180 | i = 5; |
2195 | i = 5; |
2181 | |
2196 | |
2182 | # ifdef MOUSE_SLIP_WHEELING |
2197 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2453 | Pixmap rootpixmap = None; |
2468 | Pixmap rootpixmap = None; |
2454 | XWindowAttributes wattr, wrootattr; |
2469 | XWindowAttributes wattr, wrootattr; |
2455 | |
2470 | |
2456 | pchanged = 0; |
2471 | pchanged = 0; |
2457 | |
2472 | |
2458 | if (!OPTION (Opt_transparent)) |
2473 | if (!option (Opt_transparent)) |
2459 | return pchanged; /* Don't try any more */ |
2474 | return pchanged; /* Don't try any more */ |
2460 | |
2475 | |
2461 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
2476 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
2462 | rootdepth = wrootattr.depth; |
2477 | rootdepth = wrootattr.depth; |
2463 | |
2478 | |
… | |
… | |
2733 | if (ch == C0_LF) |
2748 | if (ch == C0_LF) |
2734 | nlines++; |
2749 | nlines++; |
2735 | |
2750 | |
2736 | refresh_count++; |
2751 | refresh_count++; |
2737 | |
2752 | |
2738 | if (!OPTION (Opt_jumpScroll) |
2753 | if (!option (Opt_jumpScroll) |
2739 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2754 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2740 | { |
2755 | { |
2741 | refreshnow = true; |
2756 | refreshnow = true; |
2742 | refresh_count = 0; |
2757 | refresh_count = 0; |
2743 | ch = NOCHAR; |
2758 | ch = NOCHAR; |
… | |
… | |
2783 | * the number of pages between refreshes is refresh_limit, which |
2798 | * the number of pages between refreshes is refresh_limit, which |
2784 | * is incremented here because we must be doing flat-out scrolling. |
2799 | * is incremented here because we must be doing flat-out scrolling. |
2785 | */ |
2800 | */ |
2786 | if (refreshnow) |
2801 | if (refreshnow) |
2787 | { |
2802 | { |
2788 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2803 | if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2789 | refresh_limit++; |
2804 | refresh_limit++; |
2790 | else |
2805 | else |
2791 | { |
2806 | { |
2792 | flag = true; |
2807 | flag = true; |
2793 | //TODO: due to popular request, implement "skipscroll" option here |
2808 | //TODO: due to popular request, implement "skipscroll" option here |
… | |
… | |
3459 | break; |
3474 | break; |
3460 | case 6: /* CPR requested */ |
3475 | case 6: /* CPR requested */ |
3461 | scr_report_position (); |
3476 | scr_report_position (); |
3462 | break; |
3477 | break; |
3463 | case 7: /* unofficial extension */ |
3478 | case 7: /* unofficial extension */ |
3464 | if (OPTION (Opt_insecure)) |
3479 | if (option (Opt_insecure)) |
3465 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3480 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3466 | break; |
3481 | break; |
3467 | case 8: /* unofficial extension */ |
3482 | case 8: /* unofficial extension */ |
3468 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3483 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3469 | break; |
3484 | break; |
… | |
… | |
3633 | break; |
3648 | break; |
3634 | case 20: /* report icon label */ |
3649 | case 20: /* report icon label */ |
3635 | { |
3650 | { |
3636 | char *s; |
3651 | char *s; |
3637 | XGetIconName (dpy, parent[0], &s); |
3652 | XGetIconName (dpy, parent[0], &s); |
3638 | tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3653 | tt_printf ("\033]L%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3639 | XFree (s); |
3654 | XFree (s); |
3640 | } |
3655 | } |
3641 | break; |
3656 | break; |
3642 | case 21: /* report window title */ |
3657 | case 21: /* report window title */ |
3643 | { |
3658 | { |
3644 | char *s; |
3659 | char *s; |
3645 | XFetchName (dpy, parent[0], &s); |
3660 | XFetchName (dpy, parent[0], &s); |
3646 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3661 | tt_printf ("\033]l%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3647 | XFree (s); |
3662 | XFree (s); |
3648 | } |
3663 | } |
3649 | break; |
3664 | break; |
3650 | } |
3665 | } |
3651 | } |
3666 | } |
… | |
… | |
3959 | case URxvt_italicFont: |
3974 | case URxvt_italicFont: |
3960 | case URxvt_boldItalicFont: |
3975 | case URxvt_boldItalicFont: |
3961 | #endif |
3976 | #endif |
3962 | if (query) |
3977 | if (query) |
3963 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3978 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3964 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3979 | option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3965 | ? fontset[op - URxvt_font]->fontdesc : "", |
3980 | ? fontset[op - URxvt_font]->fontdesc : "", |
3966 | resp); |
3981 | resp); |
3967 | else |
3982 | else |
3968 | { |
3983 | { |
3969 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3984 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3983 | break; |
3998 | break; |
3984 | |
3999 | |
3985 | #if !ENABLE_MINIMAL |
4000 | #if !ENABLE_MINIMAL |
3986 | case URxvt_locale: |
4001 | case URxvt_locale: |
3987 | if (query) |
4002 | if (query) |
3988 | tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); |
4003 | tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); |
3989 | else |
4004 | else |
3990 | { |
4005 | { |
3991 | set_locale (str); |
4006 | set_locale (str); |
3992 | pty->set_utf8_mode (enc_utf8); |
4007 | pty->set_utf8_mode (enc_utf8); |
3993 | init_xlocale (); |
4008 | init_xlocale (); |
… | |
… | |
4134 | scr_touch (true); |
4149 | scr_touch (true); |
4135 | break; |
4150 | break; |
4136 | #endif |
4151 | #endif |
4137 | case 1048: /* alternative cursor save */ |
4152 | case 1048: /* alternative cursor save */ |
4138 | case 1049: |
4153 | case 1049: |
4139 | if (OPTION (Opt_secondaryScreen)) |
4154 | if (option (Opt_secondaryScreen)) |
4140 | if (mode == 0) |
4155 | if (mode == 0) |
4141 | scr_cursor (RESTORE); |
4156 | scr_cursor (RESTORE); |
4142 | else if (mode == 1) |
4157 | else if (mode == 1) |
4143 | scr_cursor (SAVE); |
4158 | scr_cursor (SAVE); |
4144 | break; |
4159 | break; |
… | |
… | |
4209 | break; |
4224 | break; |
4210 | case 1011: /* scroll to bottom on key press */ |
4225 | case 1011: /* scroll to bottom on key press */ |
4211 | set_option (Opt_scrollTtyKeypress, state); |
4226 | set_option (Opt_scrollTtyKeypress, state); |
4212 | break; |
4227 | break; |
4213 | case 1047: /* secondary screen w/ clearing last */ |
4228 | case 1047: /* secondary screen w/ clearing last */ |
4214 | if (OPTION (Opt_secondaryScreen)) |
4229 | if (option (Opt_secondaryScreen)) |
4215 | if (current_screen != PRIMARY) |
4230 | if (current_screen != PRIMARY) |
4216 | scr_erase_screen (2); |
4231 | scr_erase_screen (2); |
4217 | scr_change_screen (state); |
4232 | scr_change_screen (state); |
4218 | break; |
4233 | break; |
4219 | case 1049: /* secondary screen w/ clearing first */ |
4234 | case 1049: /* secondary screen w/ clearing first */ |
4220 | scr_change_screen (state); |
4235 | scr_change_screen (state); |
4221 | if (OPTION (Opt_secondaryScreen)) |
4236 | if (option (Opt_secondaryScreen)) |
4222 | if (current_screen != PRIMARY) |
4237 | if (current_screen != PRIMARY) |
4223 | scr_erase_screen (2); |
4238 | scr_erase_screen (2); |
4224 | break; |
4239 | break; |
4225 | default: |
4240 | default: |
4226 | break; |
4241 | break; |