… | |
… | |
497 | { |
497 | { |
498 | commit_iso14755 (); |
498 | commit_iso14755 (); |
499 | iso14755buf = ISO_14755_51; |
499 | iso14755buf = ISO_14755_51; |
500 | # if ISO_14755 |
500 | # if ISO_14755 |
501 | iso14755_51 (0); |
501 | iso14755_51 (0); |
|
|
502 | # endif |
|
|
503 | return; |
|
|
504 | } |
|
|
505 | else if (keysym == XK_BackSpace) |
|
|
506 | { |
|
|
507 | iso14755buf = ((iso14755buf & ISO_14755_MASK) >> 4) | ISO_14755_51; |
|
|
508 | # if ISO_14755 |
|
|
509 | iso14755_51 (iso14755buf & ISO_14755_MASK); |
502 | # endif |
510 | # endif |
503 | return; |
511 | return; |
504 | } |
512 | } |
505 | else if ((hv = hex_keyval (ev)) >= 0) |
513 | else if ((hv = hex_keyval (ev)) >= 0) |
506 | { |
514 | { |
… | |
… | |
877 | return; |
885 | return; |
878 | |
886 | |
879 | if (len <= 0) |
887 | if (len <= 0) |
880 | return; /* not mapped */ |
888 | return; /* not mapped */ |
881 | |
889 | |
882 | if (OPTION (Opt_scrollTtyKeypress)) |
890 | if (option (Opt_scrollTtyKeypress)) |
883 | if (view_start) |
891 | if (view_start) |
884 | { |
892 | { |
885 | view_start = 0; |
893 | view_start = 0; |
886 | want_refresh = 1; |
894 | want_refresh = 1; |
887 | } |
895 | } |
… | |
… | |
1232 | } |
1240 | } |
1233 | else |
1241 | else |
1234 | { |
1242 | { |
1235 | pty_ev.stop (); |
1243 | pty_ev.stop (); |
1236 | |
1244 | |
1237 | if (!OPTION (Opt_hold)) |
1245 | if (!option (Opt_hold)) |
1238 | destroy (); |
1246 | destroy (); |
1239 | } |
1247 | } |
1240 | |
1248 | |
1241 | return false; |
1249 | return false; |
1242 | } |
1250 | } |
… | |
… | |
1263 | recolour_cursor (); |
1271 | recolour_cursor (); |
1264 | |
1272 | |
1265 | #ifdef POINTER_BLANK |
1273 | #ifdef POINTER_BLANK |
1266 | hidden_pointer = 0; |
1274 | hidden_pointer = 0; |
1267 | |
1275 | |
1268 | if (OPTION (Opt_pointerBlank)) |
1276 | if (option (Opt_pointerBlank)) |
1269 | pointer_ev.start (NOW + pointerBlankDelay); |
1277 | pointer_ev.start (NOW + pointerBlankDelay); |
1270 | #endif |
1278 | #endif |
1271 | } |
1279 | } |
1272 | |
1280 | |
1273 | #ifdef POINTER_BLANK |
1281 | #ifdef POINTER_BLANK |
1274 | void |
1282 | void |
1275 | rxvt_term::pointer_blank () |
1283 | rxvt_term::pointer_blank () |
1276 | { |
1284 | { |
1277 | if (!OPTION (Opt_pointerBlank)) |
1285 | if (!option (Opt_pointerBlank)) |
1278 | return; |
1286 | return; |
1279 | |
1287 | |
1280 | XDefineCursor (dpy, vt, display->blank_cursor); |
1288 | XDefineCursor (dpy, vt, display->blank_cursor); |
1281 | XFlush (dpy); |
1289 | XFlush (dpy); |
1282 | |
1290 | |
… | |
… | |
1458 | break; |
1466 | break; |
1459 | } |
1467 | } |
1460 | break; |
1468 | break; |
1461 | |
1469 | |
1462 | case FocusIn: |
1470 | case FocusIn: |
|
|
1471 | if (ev.xfocus.detail != NotifyInferior |
|
|
1472 | && ev.xfocus.detail != NotifyPointer |
|
|
1473 | && ev.xfocus.mode != NotifyGrab) |
1463 | focus_in (); |
1474 | focus_in (); |
1464 | break; |
1475 | break; |
1465 | |
1476 | |
1466 | case FocusOut: |
1477 | case FocusOut: |
|
|
1478 | if (ev.xfocus.detail != NotifyInferior |
|
|
1479 | && ev.xfocus.detail != NotifyPointer |
|
|
1480 | && ev.xfocus.mode != NotifyGrab) |
1467 | focus_out (); |
1481 | focus_out (); |
1468 | break; |
1482 | break; |
1469 | |
1483 | |
1470 | case ConfigureNotify: |
1484 | case ConfigureNotify: |
1471 | if (ev.xconfigure.window == parent[0]) |
1485 | if (ev.xconfigure.window == parent[0]) |
1472 | { |
1486 | { |
… | |
… | |
1479 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1493 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1480 | } |
1494 | } |
1481 | |
1495 | |
1482 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1496 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1483 | |
1497 | |
1484 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1498 | #ifdef TRANSPARENT |
1485 | if (OPTION (Opt_transparent)) |
1499 | if (option (Opt_transparent)) |
1486 | check_our_parents (); |
1500 | check_our_parents (); |
1487 | #endif |
1501 | #endif |
1488 | } |
1502 | } |
1489 | break; |
1503 | break; |
1490 | |
1504 | |
… | |
… | |
1679 | } |
1693 | } |
1680 | break; |
1694 | break; |
1681 | } |
1695 | } |
1682 | |
1696 | |
1683 | #if defined(CURSOR_BLINK) |
1697 | #if defined(CURSOR_BLINK) |
1684 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1698 | if (option (Opt_cursorBlink) && ev.type == KeyPress) |
1685 | { |
1699 | { |
1686 | if (hidden_cursor) |
1700 | if (hidden_cursor) |
1687 | { |
1701 | { |
1688 | hidden_cursor = 0; |
1702 | hidden_cursor = 0; |
1689 | want_refresh = 1; |
1703 | want_refresh = 1; |
… | |
… | |
1692 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1706 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1693 | } |
1707 | } |
1694 | #endif |
1708 | #endif |
1695 | |
1709 | |
1696 | #if defined(POINTER_BLANK) |
1710 | #if defined(POINTER_BLANK) |
1697 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1711 | if (option (Opt_pointerBlank) && pointerBlankDelay > 0) |
1698 | { |
1712 | { |
1699 | if (ev.type == MotionNotify |
1713 | if (ev.type == MotionNotify |
1700 | || ev.type == ButtonPress |
1714 | || ev.type == ButtonPress |
1701 | || ev.type == ButtonRelease) |
1715 | || ev.type == ButtonRelease) |
1702 | if (hidden_pointer) |
1716 | if (hidden_pointer) |
… | |
… | |
1724 | IMSetPosition (); |
1738 | IMSetPosition (); |
1725 | XSetICFocus (Input_Context); |
1739 | XSetICFocus (Input_Context); |
1726 | } |
1740 | } |
1727 | #endif |
1741 | #endif |
1728 | #if CURSOR_BLINK |
1742 | #if CURSOR_BLINK |
1729 | if (OPTION (Opt_cursorBlink)) |
1743 | if (option (Opt_cursorBlink)) |
1730 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1744 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1731 | #endif |
1745 | #endif |
1732 | #if OFF_FOCUS_FADING |
1746 | #if OFF_FOCUS_FADING |
1733 | if (rs[Rs_fade]) |
1747 | if (rs[Rs_fade]) |
1734 | { |
1748 | { |
1735 | pix_colors = pix_colors_focused; |
1749 | pix_colors = pix_colors_focused; |
1736 | scr_recolour (); |
1750 | scr_recolour (); |
|
|
1751 | } |
|
|
1752 | #endif |
|
|
1753 | #if ENABLE_FRILLS |
|
|
1754 | if (option (Opt_urgentOnBell)) |
|
|
1755 | { |
|
|
1756 | XWMHints *h; |
|
|
1757 | |
|
|
1758 | h = XGetWMHints(dpy, parent[0]); |
|
|
1759 | if (h != NULL) |
|
|
1760 | { |
|
|
1761 | h->flags &= ~XUrgencyHint; |
|
|
1762 | XSetWMHints(dpy, parent[0], h); |
|
|
1763 | } |
1737 | } |
1764 | } |
1738 | #endif |
1765 | #endif |
1739 | } |
1766 | } |
1740 | } |
1767 | } |
1741 | |
1768 | |
… | |
… | |
1761 | #if USE_XIM |
1788 | #if USE_XIM |
1762 | if (Input_Context != NULL) |
1789 | if (Input_Context != NULL) |
1763 | XUnsetICFocus (Input_Context); |
1790 | XUnsetICFocus (Input_Context); |
1764 | #endif |
1791 | #endif |
1765 | #if CURSOR_BLINK |
1792 | #if CURSOR_BLINK |
1766 | if (OPTION (Opt_cursorBlink)) |
1793 | if (option (Opt_cursorBlink)) |
1767 | cursor_blink_ev.stop (); |
1794 | cursor_blink_ev.stop (); |
1768 | hidden_cursor = 0; |
1795 | hidden_cursor = 0; |
1769 | #endif |
1796 | #endif |
1770 | #if OFF_FOCUS_FADING |
1797 | #if OFF_FOCUS_FADING |
1771 | if (rs[Rs_fade]) |
1798 | if (rs[Rs_fade]) |
… | |
… | |
1812 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1839 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1813 | return; |
1840 | return; |
1814 | |
1841 | |
1815 | /* FALLTHROUGH */ |
1842 | /* FALLTHROUGH */ |
1816 | case ReparentNotify: |
1843 | case ReparentNotify: |
1817 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1844 | if (option (Opt_transparent) && check_our_parents () && am_transparent) |
1818 | want_refresh = want_full_refresh = 1; |
1845 | want_refresh = want_full_refresh = 1; |
1819 | break; |
1846 | break; |
1820 | } |
1847 | } |
1821 | # endif |
1848 | # endif |
1822 | } |
1849 | } |
… | |
… | |
2154 | selection_make (ev.time); |
2181 | selection_make (ev.time); |
2155 | break; |
2182 | break; |
2156 | |
2183 | |
2157 | case Button2: |
2184 | case Button2: |
2158 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2185 | 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); |
2186 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); |
2160 | break; |
2187 | break; |
2161 | |
2188 | |
2162 | #ifdef MOUSE_WHEEL |
2189 | #ifdef MOUSE_WHEEL |
2163 | case Button4: |
2190 | case Button4: |
2164 | case Button5: |
2191 | case Button5: |
… | |
… | |
2168 | |
2195 | |
2169 | v = ev.button == Button4 ? UP : DN; |
2196 | v = ev.button == Button4 ? UP : DN; |
2170 | |
2197 | |
2171 | if (ev.state & ShiftMask) |
2198 | if (ev.state & ShiftMask) |
2172 | i = 1; |
2199 | i = 1; |
2173 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2200 | else if (option (Opt_mouseWheelScrollPage)) |
2174 | i = nrow - 1; |
2201 | i = nrow - 1; |
2175 | else |
2202 | else |
2176 | i = 5; |
2203 | i = 5; |
2177 | |
2204 | |
2178 | # ifdef MOUSE_SLIP_WHEELING |
2205 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2449 | Pixmap rootpixmap = None; |
2476 | Pixmap rootpixmap = None; |
2450 | XWindowAttributes wattr, wrootattr; |
2477 | XWindowAttributes wattr, wrootattr; |
2451 | |
2478 | |
2452 | pchanged = 0; |
2479 | pchanged = 0; |
2453 | |
2480 | |
2454 | if (!OPTION (Opt_transparent)) |
2481 | if (!option (Opt_transparent)) |
2455 | return pchanged; /* Don't try any more */ |
2482 | return pchanged; /* Don't try any more */ |
2456 | |
2483 | |
2457 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
2484 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
2458 | rootdepth = wrootattr.depth; |
2485 | rootdepth = wrootattr.depth; |
2459 | |
2486 | |
… | |
… | |
2729 | if (ch == C0_LF) |
2756 | if (ch == C0_LF) |
2730 | nlines++; |
2757 | nlines++; |
2731 | |
2758 | |
2732 | refresh_count++; |
2759 | refresh_count++; |
2733 | |
2760 | |
2734 | if (!OPTION (Opt_jumpScroll) |
2761 | if (!option (Opt_jumpScroll) |
2735 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2762 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2736 | { |
2763 | { |
2737 | refreshnow = true; |
2764 | refreshnow = true; |
2738 | refresh_count = 0; |
2765 | refresh_count = 0; |
2739 | ch = NOCHAR; |
2766 | ch = NOCHAR; |
… | |
… | |
2779 | * the number of pages between refreshes is refresh_limit, which |
2806 | * the number of pages between refreshes is refresh_limit, which |
2780 | * is incremented here because we must be doing flat-out scrolling. |
2807 | * is incremented here because we must be doing flat-out scrolling. |
2781 | */ |
2808 | */ |
2782 | if (refreshnow) |
2809 | if (refreshnow) |
2783 | { |
2810 | { |
2784 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2811 | if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2785 | refresh_limit++; |
2812 | refresh_limit++; |
2786 | else |
2813 | else |
2787 | { |
2814 | { |
2788 | flag = true; |
2815 | flag = true; |
2789 | //TODO: due to popular request, implement "skipscroll" option here |
2816 | //TODO: due to popular request, implement "skipscroll" option here |
… | |
… | |
3455 | break; |
3482 | break; |
3456 | case 6: /* CPR requested */ |
3483 | case 6: /* CPR requested */ |
3457 | scr_report_position (); |
3484 | scr_report_position (); |
3458 | break; |
3485 | break; |
3459 | case 7: /* unofficial extension */ |
3486 | case 7: /* unofficial extension */ |
3460 | if (OPTION (Opt_insecure)) |
3487 | if (option (Opt_insecure)) |
3461 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3488 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3462 | break; |
3489 | break; |
3463 | case 8: /* unofficial extension */ |
3490 | case 8: /* unofficial extension */ |
3464 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3491 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3465 | break; |
3492 | break; |
… | |
… | |
3629 | break; |
3656 | break; |
3630 | case 20: /* report icon label */ |
3657 | case 20: /* report icon label */ |
3631 | { |
3658 | { |
3632 | char *s; |
3659 | char *s; |
3633 | XGetIconName (dpy, parent[0], &s); |
3660 | XGetIconName (dpy, parent[0], &s); |
3634 | 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 */ |
3635 | XFree (s); |
3662 | XFree (s); |
3636 | } |
3663 | } |
3637 | break; |
3664 | break; |
3638 | case 21: /* report window title */ |
3665 | case 21: /* report window title */ |
3639 | { |
3666 | { |
3640 | char *s; |
3667 | char *s; |
3641 | XFetchName (dpy, parent[0], &s); |
3668 | XFetchName (dpy, parent[0], &s); |
3642 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3669 | tt_printf ("\033]l%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3643 | XFree (s); |
3670 | XFree (s); |
3644 | } |
3671 | } |
3645 | break; |
3672 | break; |
3646 | } |
3673 | } |
3647 | } |
3674 | } |
… | |
… | |
3955 | case URxvt_italicFont: |
3982 | case URxvt_italicFont: |
3956 | case URxvt_boldItalicFont: |
3983 | case URxvt_boldItalicFont: |
3957 | #endif |
3984 | #endif |
3958 | if (query) |
3985 | if (query) |
3959 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3986 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3960 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3987 | option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3961 | ? fontset[op - URxvt_font]->fontdesc : "", |
3988 | ? fontset[op - URxvt_font]->fontdesc : "", |
3962 | resp); |
3989 | resp); |
3963 | else |
3990 | else |
3964 | { |
3991 | { |
3965 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3992 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3979 | break; |
4006 | break; |
3980 | |
4007 | |
3981 | #if !ENABLE_MINIMAL |
4008 | #if !ENABLE_MINIMAL |
3982 | case URxvt_locale: |
4009 | case URxvt_locale: |
3983 | if (query) |
4010 | if (query) |
3984 | tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); |
4011 | tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); |
3985 | else |
4012 | else |
3986 | { |
4013 | { |
3987 | set_locale (str); |
4014 | set_locale (str); |
3988 | pty->set_utf8_mode (enc_utf8); |
4015 | pty->set_utf8_mode (enc_utf8); |
3989 | init_xlocale (); |
4016 | init_xlocale (); |
… | |
… | |
4130 | scr_touch (true); |
4157 | scr_touch (true); |
4131 | break; |
4158 | break; |
4132 | #endif |
4159 | #endif |
4133 | case 1048: /* alternative cursor save */ |
4160 | case 1048: /* alternative cursor save */ |
4134 | case 1049: |
4161 | case 1049: |
4135 | if (OPTION (Opt_secondaryScreen)) |
4162 | if (option (Opt_secondaryScreen)) |
4136 | if (mode == 0) |
4163 | if (mode == 0) |
4137 | scr_cursor (RESTORE); |
4164 | scr_cursor (RESTORE); |
4138 | else if (mode == 1) |
4165 | else if (mode == 1) |
4139 | scr_cursor (SAVE); |
4166 | scr_cursor (SAVE); |
4140 | break; |
4167 | break; |
… | |
… | |
4205 | break; |
4232 | break; |
4206 | case 1011: /* scroll to bottom on key press */ |
4233 | case 1011: /* scroll to bottom on key press */ |
4207 | set_option (Opt_scrollTtyKeypress, state); |
4234 | set_option (Opt_scrollTtyKeypress, state); |
4208 | break; |
4235 | break; |
4209 | case 1047: /* secondary screen w/ clearing last */ |
4236 | case 1047: /* secondary screen w/ clearing last */ |
4210 | if (OPTION (Opt_secondaryScreen)) |
4237 | if (option (Opt_secondaryScreen)) |
4211 | if (current_screen != PRIMARY) |
4238 | if (current_screen != PRIMARY) |
4212 | scr_erase_screen (2); |
4239 | scr_erase_screen (2); |
4213 | scr_change_screen (state); |
4240 | scr_change_screen (state); |
4214 | break; |
4241 | break; |
4215 | case 1049: /* secondary screen w/ clearing first */ |
4242 | case 1049: /* secondary screen w/ clearing first */ |
4216 | scr_change_screen (state); |
4243 | scr_change_screen (state); |
4217 | if (OPTION (Opt_secondaryScreen)) |
4244 | if (option (Opt_secondaryScreen)) |
4218 | if (current_screen != PRIMARY) |
4245 | if (current_screen != PRIMARY) |
4219 | scr_erase_screen (2); |
4246 | scr_erase_screen (2); |
4220 | break; |
4247 | break; |
4221 | default: |
4248 | default: |
4222 | break; |
4249 | break; |