… | |
… | |
95 | XK_Shift_L, 0x21e7, |
95 | XK_Shift_L, 0x21e7, |
96 | XK_Shift_R, 0x21e7, |
96 | XK_Shift_R, 0x21e7, |
97 | |
97 | |
98 | XK_Shift_Lock, 0x21eb, |
98 | XK_Shift_Lock, 0x21eb, |
99 | XK_ISO_Lock, 0x21eb, |
99 | XK_ISO_Lock, 0x21eb, |
100 | XK_ISO_Lock, 0x21eb, |
|
|
101 | XK_Caps_Lock, 0x21ec, |
100 | XK_Caps_Lock, 0x21ec, |
102 | XK_Num_Lock, 0x21ed, |
101 | XK_Num_Lock, 0x21ed, |
103 | XK_ISO_Level3_Shift, 0x21ee, |
102 | XK_ISO_Level3_Shift, 0x21ee, |
104 | XK_ISO_Level3_Lock, 0x21ef, |
103 | XK_ISO_Level3_Lock, 0x21ef, |
105 | XK_ISO_Group_Lock, 0x21f0, |
104 | XK_ISO_Group_Lock, 0x21f0, |
… | |
… | |
519 | # endif |
518 | # endif |
520 | return; |
519 | return; |
521 | } |
520 | } |
522 | else |
521 | else |
523 | { |
522 | { |
524 | # if ENABLE_OVERLAY |
523 | # if ISO_14755 |
525 | scr_overlay_off (); |
524 | scr_overlay_off (); |
526 | # endif |
525 | # endif |
527 | iso14755buf = 0; |
526 | iso14755buf = 0; |
528 | } |
527 | } |
529 | } |
528 | } |
530 | else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) |
529 | else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) |
531 | || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) |
530 | || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) |
532 | if (!(iso14755buf & ISO_14755_STARTED)) |
531 | if (!(iso14755buf & ISO_14755_STARTED)) |
533 | { |
532 | { |
534 | iso14755buf |= ISO_14755_STARTED; |
533 | iso14755buf |= ISO_14755_STARTED; |
535 | # if ENABLE_OVERLAY |
534 | # if ISO_14755 |
536 | scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); |
535 | scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); |
537 | scr_overlay_set (0, 0, "ISO 14755 mode"); |
536 | scr_overlay_set (0, 0, "ISO 14755 mode"); |
538 | # endif |
537 | # endif |
539 | } |
538 | } |
540 | #endif |
539 | #endif |
… | |
… | |
728 | |
727 | |
729 | case XK_Find: |
728 | case XK_Find: |
730 | strcpy (kbuf, "\033[1~"); |
729 | strcpy (kbuf, "\033[1~"); |
731 | break; |
730 | break; |
732 | |
731 | |
733 | #ifdef XK_KP_End |
732 | #ifdef XK_KP_Insert |
734 | case XK_KP_Insert: |
733 | case XK_KP_Insert: |
735 | /* allow shift to override */ |
734 | /* allow shift to override */ |
736 | if ((priv_modes & PrivMode_aplKP) ? !shft : shft) |
735 | if ((priv_modes & PrivMode_aplKP) ? !shft : shft) |
737 | { |
736 | { |
738 | strcpy (kbuf, "\033Op"); |
737 | strcpy (kbuf, "\033Op"); |
… | |
… | |
934 | #if ENABLE_FRILLS || ISO_14755 |
933 | #if ENABLE_FRILLS || ISO_14755 |
935 | // ISO 14755 support |
934 | // ISO 14755 support |
936 | if (iso14755buf) |
935 | if (iso14755buf) |
937 | if (iso14755buf & ISO_14755_52) |
936 | if (iso14755buf & ISO_14755_52) |
938 | { |
937 | { |
939 | # if ENABLE_OVERLAY |
938 | # if ISO_14755 |
940 | scr_overlay_off (); |
939 | scr_overlay_off (); |
941 | # endif |
940 | # endif |
942 | # if ISO_14755 |
941 | # if ISO_14755 |
943 | // iso14755 part 5.2 handling: release time |
942 | // iso14755 part 5.2 handling: release time |
944 | // first: controls |
943 | // first: controls |
… | |
… | |
967 | |
966 | |
968 | return; |
967 | return; |
969 | } |
968 | } |
970 | else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask)) |
969 | else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask)) |
971 | { |
970 | { |
972 | # if ENABLE_OVERLAY |
971 | # if ISO_14755 |
973 | scr_overlay_off (); |
972 | scr_overlay_off (); |
974 | # endif |
973 | # endif |
975 | if (iso14755buf & ISO_14755_51) |
974 | if (iso14755buf & ISO_14755_51) |
976 | commit_iso14755 (); |
975 | commit_iso14755 (); |
977 | #if ISO_14755 |
976 | #if ISO_14755 |
… | |
… | |
1035 | void |
1034 | void |
1036 | rxvt_term::flush () |
1035 | rxvt_term::flush () |
1037 | { |
1036 | { |
1038 | flush_ev.stop (); |
1037 | flush_ev.stop (); |
1039 | |
1038 | |
1040 | #ifdef TRANSPARENT |
1039 | #ifdef ENABLE_TRANSPARENCY |
1041 | if (want_full_refresh) |
1040 | if (want_full_refresh) |
1042 | { |
1041 | { |
1043 | want_full_refresh = 0; |
1042 | want_full_refresh = 0; |
1044 | scr_clear (); |
1043 | scr_clear (); |
1045 | scr_touch (false); |
1044 | scr_touch (false); |
… | |
… | |
1433 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
1432 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
1434 | focus_out (); |
1433 | focus_out (); |
1435 | } |
1434 | } |
1436 | #endif |
1435 | #endif |
1437 | } |
1436 | } |
1438 | break; |
|
|
1439 | |
|
|
1440 | case MappingNotify: |
|
|
1441 | XRefreshKeyboardMapping (&ev.xmapping); |
|
|
1442 | break; |
1437 | break; |
1443 | |
1438 | |
1444 | /* |
1439 | /* |
1445 | * XXX: this is not the _current_ arrangement |
1440 | * XXX: this is not the _current_ arrangement |
1446 | * Here's my conclusion: |
1441 | * Here's my conclusion: |
… | |
… | |
1479 | && ev.xfocus.mode != NotifyGrab) |
1474 | && ev.xfocus.mode != NotifyGrab) |
1480 | focus_out (); |
1475 | focus_out (); |
1481 | break; |
1476 | break; |
1482 | |
1477 | |
1483 | case ConfigureNotify: |
1478 | case ConfigureNotify: |
|
|
1479 | /* fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n", |
|
|
1480 | ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y, |
|
|
1481 | szHint.width, szHint.height);*/ |
1484 | if (ev.xconfigure.window == parent[0]) |
1482 | if (ev.xconfigure.window == parent[0]) |
1485 | { |
1483 | { |
1486 | while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) |
1484 | while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) |
1487 | ; |
1485 | ; |
1488 | |
1486 | |
1489 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1487 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1490 | { |
1488 | { |
1491 | seen_resize = 1; |
1489 | seen_resize = 1; |
1492 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1490 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1493 | #ifdef XPM_BACKGROUND |
|
|
1494 | if (!option (Opt_transparent) && bgPixmap.auto_resize) |
|
|
1495 | { |
|
|
1496 | resize_pixmap (); |
|
|
1497 | scr_touch (true); |
|
|
1498 | } |
|
|
1499 | #endif |
|
|
1500 | } |
1491 | } |
1501 | |
1492 | else |
|
|
1493 | { |
|
|
1494 | #ifdef ENABLE_TRANSPARENCY |
|
|
1495 | if (option (Opt_transparent)) |
|
|
1496 | update_background (); |
|
|
1497 | #endif |
|
|
1498 | } |
1502 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1499 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1503 | |
|
|
1504 | #ifdef TRANSPARENT |
|
|
1505 | if (option (Opt_transparent)) |
|
|
1506 | check_our_parents (); |
|
|
1507 | #endif |
|
|
1508 | } |
1500 | } |
1509 | break; |
1501 | break; |
1510 | |
1502 | |
1511 | case PropertyNotify: |
1503 | case PropertyNotify: |
1512 | if (!HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END))) |
1504 | if (!HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END))) |
… | |
… | |
1543 | text_blink_ev.stop (); |
1535 | text_blink_ev.stop (); |
1544 | #endif |
1536 | #endif |
1545 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1537 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1546 | break; |
1538 | break; |
1547 | |
1539 | |
1548 | #ifdef TRANSPARENT |
1540 | #ifdef ENABLE_TRANSPARENCY |
1549 | case ReparentNotify: |
1541 | case ReparentNotify: |
1550 | rootwin_cb (ev); |
1542 | rootwin_cb (ev); |
1551 | break; |
1543 | break; |
1552 | #endif /* TRANSPARENT */ |
1544 | #endif /* ENABLE_TRANSPARENCY */ |
1553 | |
1545 | |
1554 | case GraphicsExpose: |
1546 | case GraphicsExpose: |
1555 | case Expose: |
1547 | case Expose: |
1556 | if (ev.xany.window == vt) |
1548 | if (ev.xany.window == vt) |
1557 | { |
1549 | { |
… | |
… | |
1580 | if (isScrollbarWindow (ev.xany.window)) |
1572 | if (isScrollbarWindow (ev.xany.window)) |
1581 | { |
1573 | { |
1582 | scrollBar.setIdle (); |
1574 | scrollBar.setIdle (); |
1583 | scrollbar_show (0); |
1575 | scrollbar_show (0); |
1584 | } |
1576 | } |
1585 | |
|
|
1586 | #ifdef TRANSPARENT |
|
|
1587 | if (am_transparent && ev.xany.window == parent[0]) |
|
|
1588 | XClearWindow (dpy, ev.xany.window); |
|
|
1589 | #endif |
|
|
1590 | } |
1577 | } |
1591 | break; |
1578 | break; |
1592 | |
1579 | |
1593 | case MotionNotify: |
1580 | case MotionNotify: |
1594 | #ifdef POINTER_BLANK |
1581 | #ifdef POINTER_BLANK |
… | |
… | |
1783 | |
1770 | |
1784 | #if ENABLE_FRILLS || ISO_14755 |
1771 | #if ENABLE_FRILLS || ISO_14755 |
1785 | if (iso14755buf) |
1772 | if (iso14755buf) |
1786 | { |
1773 | { |
1787 | iso14755buf = 0; |
1774 | iso14755buf = 0; |
1788 | # if ENABLE_OVERLAY |
1775 | # if ISO_14755 |
1789 | scr_overlay_off (); |
1776 | scr_overlay_off (); |
1790 | # endif |
1777 | # endif |
1791 | } |
1778 | } |
1792 | #endif |
1779 | #endif |
1793 | #if USE_XIM |
1780 | #if USE_XIM |
… | |
… | |
1820 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1807 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1821 | } |
1808 | } |
1822 | #endif |
1809 | #endif |
1823 | } |
1810 | } |
1824 | |
1811 | |
1825 | #if TRANSPARENT || ENABLE_PERL |
1812 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1826 | void |
1813 | void |
1827 | rxvt_term::rootwin_cb (XEvent &ev) |
1814 | rxvt_term::rootwin_cb (XEvent &ev) |
1828 | { |
1815 | { |
1829 | make_current (); |
1816 | make_current (); |
1830 | |
1817 | |
1831 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1818 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1832 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
1819 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
1833 | return; |
1820 | return; |
1834 | |
1821 | |
1835 | # if TRANSPARENT |
1822 | # if ENABLE_TRANSPARENCY |
1836 | switch (ev.type) |
1823 | switch (ev.type) |
1837 | { |
1824 | { |
1838 | case PropertyNotify: |
1825 | case PropertyNotify: |
1839 | /* |
1826 | /* |
1840 | * if user used some Esetroot compatible prog to set the root bg, |
1827 | * if user used some Esetroot compatible prog to set the root bg, |
1841 | * use the property to determine the pixmap. We use it later on. |
1828 | * use the property to determine the pixmap. We use it later on. |
1842 | */ |
1829 | */ |
1843 | if (ev.xproperty.atom != xa[XA_XROOTPMAP_ID] |
1830 | if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID] |
1844 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1831 | || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) |
1845 | return; |
1832 | { |
1846 | |
1833 | bgPixmap.set_root_pixmap (); |
1847 | /* FALLTHROUGH */ |
1834 | update_background (); |
1848 | case ReparentNotify: |
1835 | } |
1849 | if (option (Opt_transparent)) |
|
|
1850 | check_our_parents (); |
|
|
1851 | break; |
1836 | break; |
1852 | } |
1837 | } |
1853 | # endif |
1838 | # endif |
1854 | } |
1839 | } |
1855 | #endif |
1840 | #endif |
… | |
… | |
2574 | process_dcs_seq (); |
2559 | process_dcs_seq (); |
2575 | break; |
2560 | break; |
2576 | case 0x9b: /* CSI */ |
2561 | case 0x9b: /* CSI */ |
2577 | process_csi_seq (); |
2562 | process_csi_seq (); |
2578 | break; |
2563 | break; |
2579 | case 0x9d: /* CSI */ |
2564 | case 0x9d: /* OSC */ |
2580 | process_osc_seq (); |
2565 | process_osc_seq (); |
2581 | break; |
2566 | break; |
2582 | #endif |
2567 | #endif |
2583 | } |
2568 | } |
2584 | } |
2569 | } |
… | |
… | |
2812 | unicode_t ch, priv, i; |
2797 | unicode_t ch, priv, i; |
2813 | unsigned int nargs, p; |
2798 | unsigned int nargs, p; |
2814 | int n, ndef; |
2799 | int n, ndef; |
2815 | int arg[ESC_ARGS]; |
2800 | int arg[ESC_ARGS]; |
2816 | |
2801 | |
2817 | for (nargs = ESC_ARGS; nargs > 0;) |
2802 | memset (arg, 0, sizeof (arg)); |
2818 | arg[--nargs] = 0; |
2803 | nargs = 0; |
2819 | |
2804 | |
2820 | priv = 0; |
2805 | priv = 0; |
2821 | ch = cmd_getc (); |
2806 | ch = cmd_getc (); |
2822 | if (ch >= '<' && ch <= '?') |
2807 | if (ch >= '<' && ch <= '?') |
2823 | { /* '<' '=' '>' '?' */ |
2808 | { /* '<' '=' '>' '?' */ |
… | |
… | |
2867 | switch (priv) |
2852 | switch (priv) |
2868 | { |
2853 | { |
2869 | case '>': |
2854 | case '>': |
2870 | if (ch == CSI_DA) /* secondary device attributes */ |
2855 | if (ch == CSI_DA) /* secondary device attributes */ |
2871 | { |
2856 | { |
2872 | // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, |
2857 | // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt, |
2873 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2858 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2874 | // |
2859 | // |
2875 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2860 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2876 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
2861 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
2877 | // that we do not support xterm mouse reporting (should be 95 when we do). |
2862 | // that we do not support xterm mouse reporting (should be 95 when we do). |
… | |
… | |
3435 | break; |
3420 | break; |
3436 | case URxvt_Color_IT: |
3421 | case URxvt_Color_IT: |
3437 | process_color_seq (op, Color_IT, str, resp); |
3422 | process_color_seq (op, Color_IT, str, resp); |
3438 | break; |
3423 | break; |
3439 | #endif |
3424 | #endif |
3440 | #if TRANSPARENT && TINTING |
3425 | #if ENABLE_TRANSPARENCY |
3441 | case URxvt_Color_tint: |
3426 | case URxvt_Color_tint: |
3442 | process_color_seq (op, Color_tint, str, resp); |
3427 | process_color_seq (op, Color_tint, str, resp); |
|
|
3428 | { |
|
|
3429 | bool changed = false; |
|
|
3430 | if (ISSET_PIXCOLOR (Color_tint)) |
|
|
3431 | changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]); |
|
|
3432 | else |
|
|
3433 | changed = bgPixmap.unset_tint (); |
|
|
3434 | if (changed) |
|
|
3435 | update_background (); |
|
|
3436 | } |
3443 | |
3437 | |
3444 | check_our_parents (); |
|
|
3445 | |
|
|
3446 | if (am_transparent) |
|
|
3447 | want_full_refresh = want_refresh = 1; |
|
|
3448 | |
|
|
3449 | break; |
3438 | break; |
3450 | #endif |
3439 | #endif |
3451 | |
3440 | |
|
|
3441 | #if XPM_BACKGROUND |
3452 | case Rxvt_Pixmap: |
3442 | case Rxvt_Pixmap: |
3453 | { |
3443 | if (!strcmp (str, "?")) |
3454 | if (*str != ';') |
|
|
3455 | { |
3444 | { |
3456 | #if XPM_BACKGROUND |
3445 | char str[256]; |
3457 | scale_pixmap (""); /* reset to default scaling */ |
3446 | |
3458 | set_bgPixmap (str); /* change pixmap */ |
3447 | sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */ |
3459 | scr_touch (true); |
3448 | min (bgPixmap.h_scale, 32767), min (bgPixmap.v_scale, 32767), |
3460 | #endif |
3449 | min (bgPixmap.h_align, 32767), min (bgPixmap.v_align, 32767)); |
|
|
3450 | process_xterm_seq (XTerm_title, str, CHAR_ST); |
3461 | } |
3451 | } |
3462 | |
3452 | else |
|
|
3453 | { |
3463 | int changed = 0; |
3454 | int changed = 0; |
3464 | |
3455 | |
3465 | while ((str = strchr (str, ';')) != NULL) |
3456 | if (*str != ';') |
3466 | { |
3457 | { |
|
|
3458 | /* reset to default scaling :*/ |
|
|
3459 | bgPixmap.unset_geometry (); |
|
|
3460 | if (bgPixmap.set_file (str)) /* change pixmap */ |
|
|
3461 | changed++; |
|
|
3462 | str = strchr (str, ';'); |
|
|
3463 | if (str == NULL) |
|
|
3464 | bgPixmap.set_defaultGeometry (); |
|
|
3465 | } |
|
|
3466 | while (str) |
|
|
3467 | { |
3467 | str++; |
3468 | str++; |
3468 | #if XPM_BACKGROUND |
3469 | if (bgPixmap.set_geometry (str)) |
3469 | changed += scale_pixmap (str); |
3470 | changed++; |
3470 | #endif |
3471 | str = strchr (str, ';'); |
3471 | } |
3472 | } |
3472 | |
|
|
3473 | if (changed) |
3473 | if (changed) |
3474 | { |
3474 | update_background (); |
3475 | #ifdef XPM_BACKGROUND |
|
|
3476 | resize_pixmap (); |
|
|
3477 | scr_touch (true); |
|
|
3478 | #endif |
|
|
3479 | } |
3475 | } |
3480 | #if TRANSPARENT && defined(HAVE_AFTERIMAGE) |
|
|
3481 | if (option (Opt_transparent)) |
|
|
3482 | check_our_parents (); |
|
|
3483 | #endif |
|
|
3484 | } |
|
|
3485 | break; |
3476 | break; |
|
|
3477 | #endif |
3486 | |
3478 | |
3487 | case Rxvt_restoreFG: |
3479 | case Rxvt_restoreFG: |
3488 | set_window_color (Color_fg, str); |
3480 | set_window_color (Color_fg, str); |
3489 | break; |
3481 | break; |
3490 | case Rxvt_restoreBG: |
3482 | case Rxvt_restoreBG: |
… | |
… | |
3612 | { |
3604 | { |
3613 | unsigned int i, j; |
3605 | unsigned int i, j; |
3614 | int state; |
3606 | int state; |
3615 | |
3607 | |
3616 | static const struct |
3608 | static const struct |
3617 | { |
3609 | { |
3618 | const int argval; |
3610 | const int argval; |
3619 | const unsigned long bit; |
3611 | const unsigned long bit; |
3620 | } |
|
|
3621 | |
|
|
3622 | argtopriv[] = { |
3612 | } argtopriv[] = { |
3623 | { 1, PrivMode_aplCUR }, |
3613 | { 1, PrivMode_aplCUR }, |
3624 | { 2, PrivMode_vt52 }, |
3614 | { 2, PrivMode_vt52 }, |
3625 | { 3, PrivMode_132 }, |
3615 | { 3, PrivMode_132 }, |
3626 | { 4, PrivMode_smoothScroll }, |
3616 | { 4, PrivMode_smoothScroll }, |
3627 | { 5, PrivMode_rVideo }, |
3617 | { 5, PrivMode_rVideo }, |