… | |
… | |
519 | # endif |
519 | # endif |
520 | return; |
520 | return; |
521 | } |
521 | } |
522 | else |
522 | else |
523 | { |
523 | { |
524 | # if ENABLE_OVERLAY |
524 | # if ISO_14755 |
525 | scr_overlay_off (); |
525 | scr_overlay_off (); |
526 | # endif |
526 | # endif |
527 | iso14755buf = 0; |
527 | iso14755buf = 0; |
528 | } |
528 | } |
529 | } |
529 | } |
530 | else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) |
530 | else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) |
531 | || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) |
531 | || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) |
532 | if (!(iso14755buf & ISO_14755_STARTED)) |
532 | if (!(iso14755buf & ISO_14755_STARTED)) |
533 | { |
533 | { |
534 | iso14755buf |= ISO_14755_STARTED; |
534 | iso14755buf |= ISO_14755_STARTED; |
535 | # if ENABLE_OVERLAY |
535 | # if ISO_14755 |
536 | scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); |
536 | scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); |
537 | scr_overlay_set (0, 0, "ISO 14755 mode"); |
537 | scr_overlay_set (0, 0, "ISO 14755 mode"); |
538 | # endif |
538 | # endif |
539 | } |
539 | } |
540 | #endif |
540 | #endif |
… | |
… | |
728 | |
728 | |
729 | case XK_Find: |
729 | case XK_Find: |
730 | strcpy (kbuf, "\033[1~"); |
730 | strcpy (kbuf, "\033[1~"); |
731 | break; |
731 | break; |
732 | |
732 | |
733 | #ifdef XK_KP_End |
733 | #ifdef XK_KP_Insert |
734 | case XK_KP_Insert: |
734 | case XK_KP_Insert: |
735 | /* allow shift to override */ |
735 | /* allow shift to override */ |
736 | if ((priv_modes & PrivMode_aplKP) ? !shft : shft) |
736 | if ((priv_modes & PrivMode_aplKP) ? !shft : shft) |
737 | { |
737 | { |
738 | strcpy (kbuf, "\033Op"); |
738 | strcpy (kbuf, "\033Op"); |
… | |
… | |
934 | #if ENABLE_FRILLS || ISO_14755 |
934 | #if ENABLE_FRILLS || ISO_14755 |
935 | // ISO 14755 support |
935 | // ISO 14755 support |
936 | if (iso14755buf) |
936 | if (iso14755buf) |
937 | if (iso14755buf & ISO_14755_52) |
937 | if (iso14755buf & ISO_14755_52) |
938 | { |
938 | { |
939 | # if ENABLE_OVERLAY |
939 | # if ISO_14755 |
940 | scr_overlay_off (); |
940 | scr_overlay_off (); |
941 | # endif |
941 | # endif |
942 | # if ISO_14755 |
942 | # if ISO_14755 |
943 | // iso14755 part 5.2 handling: release time |
943 | // iso14755 part 5.2 handling: release time |
944 | // first: controls |
944 | // first: controls |
… | |
… | |
967 | |
967 | |
968 | return; |
968 | return; |
969 | } |
969 | } |
970 | else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask)) |
970 | else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask)) |
971 | { |
971 | { |
972 | # if ENABLE_OVERLAY |
972 | # if ISO_14755 |
973 | scr_overlay_off (); |
973 | scr_overlay_off (); |
974 | # endif |
974 | # endif |
975 | if (iso14755buf & ISO_14755_51) |
975 | if (iso14755buf & ISO_14755_51) |
976 | commit_iso14755 (); |
976 | commit_iso14755 (); |
977 | #if ISO_14755 |
977 | #if ISO_14755 |
… | |
… | |
1035 | void |
1035 | void |
1036 | rxvt_term::flush () |
1036 | rxvt_term::flush () |
1037 | { |
1037 | { |
1038 | flush_ev.stop (); |
1038 | flush_ev.stop (); |
1039 | |
1039 | |
1040 | #ifdef TRANSPARENT |
1040 | #ifdef ENABLE_TRANSPARENCY |
1041 | if (want_full_refresh) |
1041 | if (want_full_refresh) |
1042 | { |
1042 | { |
1043 | want_full_refresh = 0; |
1043 | want_full_refresh = 0; |
1044 | scr_clear (); |
1044 | scr_clear (); |
1045 | scr_touch (false); |
1045 | scr_touch (false); |
… | |
… | |
1110 | void |
1110 | void |
1111 | rxvt_term::flush_cb (time_watcher &w) |
1111 | rxvt_term::flush_cb (time_watcher &w) |
1112 | { |
1112 | { |
1113 | make_current (); |
1113 | make_current (); |
1114 | |
1114 | |
1115 | refresh_limit = 1; |
|
|
1116 | refresh_count = 0; |
1115 | refresh_count = 0; |
1117 | flush (); |
1116 | flush (); |
1118 | } |
1117 | } |
1119 | |
1118 | |
1120 | #ifdef CURSOR_BLINK |
1119 | #ifdef CURSOR_BLINK |
… | |
… | |
1434 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
1433 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
1435 | focus_out (); |
1434 | focus_out (); |
1436 | } |
1435 | } |
1437 | #endif |
1436 | #endif |
1438 | } |
1437 | } |
1439 | break; |
|
|
1440 | |
|
|
1441 | case MappingNotify: |
|
|
1442 | XRefreshKeyboardMapping (&ev.xmapping); |
|
|
1443 | break; |
1438 | break; |
1444 | |
1439 | |
1445 | /* |
1440 | /* |
1446 | * XXX: this is not the _current_ arrangement |
1441 | * XXX: this is not the _current_ arrangement |
1447 | * Here's my conclusion: |
1442 | * Here's my conclusion: |
… | |
… | |
1489 | |
1484 | |
1490 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1485 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1491 | { |
1486 | { |
1492 | seen_resize = 1; |
1487 | seen_resize = 1; |
1493 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1488 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1494 | #ifdef XPM_BACKGROUND |
1489 | #ifdef HAVE_BG_PIXMAP |
|
|
1490 | /* TODO: replace with update_pixmap() that should unify transparency and bg image handling ! */ |
1495 | if (!option (Opt_transparent) && bgPixmap.auto_resize) |
1491 | if (!option (Opt_transparent) && bgPixmap.window_size_sensitive ()) |
1496 | { |
1492 | { |
1497 | resize_pixmap (); |
1493 | resize_pixmap (); |
1498 | scr_touch (true); |
1494 | scr_touch (true); |
1499 | } |
1495 | } |
1500 | #endif |
1496 | #endif |
1501 | } |
1497 | } |
1502 | |
1498 | |
1503 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1499 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1504 | |
1500 | |
1505 | #ifdef TRANSPARENT |
1501 | #ifdef ENABLE_TRANSPARENCY |
1506 | if (option (Opt_transparent)) |
1502 | if (option (Opt_transparent)) |
1507 | check_our_parents (); |
1503 | check_our_parents (); |
1508 | #endif |
1504 | #endif |
1509 | } |
1505 | } |
1510 | break; |
1506 | break; |
… | |
… | |
1544 | text_blink_ev.stop (); |
1540 | text_blink_ev.stop (); |
1545 | #endif |
1541 | #endif |
1546 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1542 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1547 | break; |
1543 | break; |
1548 | |
1544 | |
1549 | #ifdef TRANSPARENT |
1545 | #ifdef ENABLE_TRANSPARENCY |
1550 | case ReparentNotify: |
1546 | case ReparentNotify: |
1551 | rootwin_cb (ev); |
1547 | rootwin_cb (ev); |
1552 | break; |
1548 | break; |
1553 | #endif /* TRANSPARENT */ |
1549 | #endif /* ENABLE_TRANSPARENCY */ |
1554 | |
1550 | |
1555 | case GraphicsExpose: |
1551 | case GraphicsExpose: |
1556 | case Expose: |
1552 | case Expose: |
1557 | if (ev.xany.window == vt) |
1553 | if (ev.xany.window == vt) |
1558 | { |
1554 | { |
… | |
… | |
1582 | { |
1578 | { |
1583 | scrollBar.setIdle (); |
1579 | scrollBar.setIdle (); |
1584 | scrollbar_show (0); |
1580 | scrollbar_show (0); |
1585 | } |
1581 | } |
1586 | |
1582 | |
1587 | #ifdef TRANSPARENT |
1583 | #ifdef ENABLE_TRANSPARENCY |
1588 | if (am_transparent && ev.xany.window == parent[0]) |
1584 | if (am_transparent && ev.xany.window == parent[0]) |
1589 | XClearWindow (dpy, ev.xany.window); |
1585 | XClearWindow (dpy, ev.xany.window); |
1590 | #endif |
1586 | #endif |
1591 | } |
1587 | } |
1592 | break; |
1588 | break; |
… | |
… | |
1693 | &ev.xbutton.x, &ev.xbutton.y, |
1689 | &ev.xbutton.x, &ev.xbutton.y, |
1694 | &unused_mask); |
1690 | &unused_mask); |
1695 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1691 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1696 | scrollbar_size ()); |
1692 | scrollbar_size ()); |
1697 | want_refresh = 1; |
1693 | want_refresh = 1; |
1698 | refresh_limit = 0; |
|
|
1699 | scrollbar_show (1); |
1694 | scrollbar_show (1); |
1700 | } |
1695 | } |
1701 | break; |
1696 | break; |
1702 | } |
1697 | } |
1703 | |
1698 | |
… | |
… | |
1785 | |
1780 | |
1786 | #if ENABLE_FRILLS || ISO_14755 |
1781 | #if ENABLE_FRILLS || ISO_14755 |
1787 | if (iso14755buf) |
1782 | if (iso14755buf) |
1788 | { |
1783 | { |
1789 | iso14755buf = 0; |
1784 | iso14755buf = 0; |
1790 | # if ENABLE_OVERLAY |
1785 | # if ISO_14755 |
1791 | scr_overlay_off (); |
1786 | scr_overlay_off (); |
1792 | # endif |
1787 | # endif |
1793 | } |
1788 | } |
1794 | #endif |
1789 | #endif |
1795 | #if USE_XIM |
1790 | #if USE_XIM |
… | |
… | |
1822 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1817 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1823 | } |
1818 | } |
1824 | #endif |
1819 | #endif |
1825 | } |
1820 | } |
1826 | |
1821 | |
1827 | #if TRANSPARENT || ENABLE_PERL |
1822 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1828 | void |
1823 | void |
1829 | rxvt_term::rootwin_cb (XEvent &ev) |
1824 | rxvt_term::rootwin_cb (XEvent &ev) |
1830 | { |
1825 | { |
1831 | make_current (); |
1826 | make_current (); |
1832 | |
1827 | |
1833 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1828 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1834 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
1829 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
1835 | return; |
1830 | return; |
1836 | |
1831 | |
1837 | # if TRANSPARENT |
1832 | # if ENABLE_TRANSPARENCY |
1838 | switch (ev.type) |
1833 | switch (ev.type) |
1839 | { |
1834 | { |
1840 | case PropertyNotify: |
1835 | case PropertyNotify: |
1841 | /* |
1836 | /* |
1842 | * if user used some Esetroot compatible prog to set the root bg, |
1837 | * if user used some Esetroot compatible prog to set the root bg, |
… | |
… | |
2291 | if (ch == C0_LF) |
2286 | if (ch == C0_LF) |
2292 | nlines++; |
2287 | nlines++; |
2293 | |
2288 | |
2294 | refresh_count++; |
2289 | refresh_count++; |
2295 | |
2290 | |
2296 | if (!option (Opt_jumpScroll) |
2291 | if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) |
2297 | || (refresh_count >= refresh_limit * (nrow - 1))) |
|
|
2298 | { |
2292 | { |
2299 | refreshnow = true; |
|
|
2300 | refresh_count = 0; |
2293 | refresh_count = 0; |
|
|
2294 | |
|
|
2295 | if (!option (Opt_skipScroll) || io_manager::now () > NOW + 1. / 60.) |
|
|
2296 | { |
|
|
2297 | refreshnow = true; |
2301 | ch = NOCHAR; |
2298 | ch = NOCHAR; |
2302 | break; |
2299 | break; |
|
|
2300 | } |
2303 | } |
2301 | } |
2304 | |
2302 | |
2305 | // scr_add_lines only works for nlines <= nrow - 1. |
2303 | // scr_add_lines only works for nlines <= nrow - 1. |
2306 | if (nlines >= nrow - 1) |
2304 | if (nlines >= nrow - 1) |
2307 | { |
2305 | { |
… | |
… | |
2335 | && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) |
2333 | && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) |
2336 | scr_add_lines (buf, str - buf, nlines); |
2334 | scr_add_lines (buf, str - buf, nlines); |
2337 | |
2335 | |
2338 | /* |
2336 | /* |
2339 | * If there have been a lot of new lines, then update the screen |
2337 | * If there have been a lot of new lines, then update the screen |
2340 | * What the heck I'll cheat and only refresh less than every page-full. |
2338 | * What the heck we'll cheat and only refresh less than every page-full. |
2341 | * the number of pages between refreshes is refresh_limit, which |
2339 | * if skipScroll is enabled. |
2342 | * is incremented here because we must be doing flat-out scrolling. |
|
|
2343 | */ |
2340 | */ |
2344 | if (refreshnow) |
2341 | if (refreshnow) |
2345 | { |
2342 | { |
2346 | if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
|
|
2347 | refresh_limit++; |
|
|
2348 | else |
|
|
2349 | { |
|
|
2350 | flag = true; |
2343 | flag = true; |
2351 | //TODO: due to popular request, implement "skipscroll" option here |
|
|
2352 | scr_refresh (); |
2344 | scr_refresh (); |
2353 | want_refresh = 1; |
2345 | want_refresh = 1; |
2354 | } |
|
|
2355 | } |
2346 | } |
2356 | |
2347 | |
2357 | } |
2348 | } |
2358 | else |
2349 | else |
2359 | { |
2350 | { |
… | |
… | |
2580 | process_dcs_seq (); |
2571 | process_dcs_seq (); |
2581 | break; |
2572 | break; |
2582 | case 0x9b: /* CSI */ |
2573 | case 0x9b: /* CSI */ |
2583 | process_csi_seq (); |
2574 | process_csi_seq (); |
2584 | break; |
2575 | break; |
2585 | case 0x9d: /* CSI */ |
2576 | case 0x9d: /* OSC */ |
2586 | process_osc_seq (); |
2577 | process_osc_seq (); |
2587 | break; |
2578 | break; |
2588 | #endif |
2579 | #endif |
2589 | } |
2580 | } |
2590 | } |
2581 | } |
… | |
… | |
2818 | unicode_t ch, priv, i; |
2809 | unicode_t ch, priv, i; |
2819 | unsigned int nargs, p; |
2810 | unsigned int nargs, p; |
2820 | int n, ndef; |
2811 | int n, ndef; |
2821 | int arg[ESC_ARGS]; |
2812 | int arg[ESC_ARGS]; |
2822 | |
2813 | |
2823 | for (nargs = ESC_ARGS; nargs > 0;) |
2814 | memset (arg, 0, sizeof (arg)); |
2824 | arg[--nargs] = 0; |
2815 | nargs = 0; |
2825 | |
2816 | |
2826 | priv = 0; |
2817 | priv = 0; |
2827 | ch = cmd_getc (); |
2818 | ch = cmd_getc (); |
2828 | if (ch >= '<' && ch <= '?') |
2819 | if (ch >= '<' && ch <= '?') |
2829 | { /* '<' '=' '>' '?' */ |
2820 | { /* '<' '=' '>' '?' */ |
… | |
… | |
2873 | switch (priv) |
2864 | switch (priv) |
2874 | { |
2865 | { |
2875 | case '>': |
2866 | case '>': |
2876 | if (ch == CSI_DA) /* secondary device attributes */ |
2867 | if (ch == CSI_DA) /* secondary device attributes */ |
2877 | { |
2868 | { |
2878 | // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, |
2869 | // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt, |
2879 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2870 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2880 | // |
2871 | // |
2881 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2872 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2882 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
2873 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
2883 | // that we do not support xterm mouse reporting (should be 95 when we do). |
2874 | // that we do not support xterm mouse reporting (should be 95 when we do). |
… | |
… | |
3441 | break; |
3432 | break; |
3442 | case URxvt_Color_IT: |
3433 | case URxvt_Color_IT: |
3443 | process_color_seq (op, Color_IT, str, resp); |
3434 | process_color_seq (op, Color_IT, str, resp); |
3444 | break; |
3435 | break; |
3445 | #endif |
3436 | #endif |
3446 | #if TRANSPARENT && TINTING |
3437 | #if ENABLE_TRANSPARENCY && TINTING |
3447 | case URxvt_Color_tint: |
3438 | case URxvt_Color_tint: |
3448 | process_color_seq (op, Color_tint, str, resp); |
3439 | process_color_seq (op, Color_tint, str, resp); |
3449 | |
3440 | |
3450 | check_our_parents (); |
3441 | check_our_parents (); |
3451 | |
3442 | |
… | |
… | |
3453 | want_full_refresh = want_refresh = 1; |
3444 | want_full_refresh = want_refresh = 1; |
3454 | |
3445 | |
3455 | break; |
3446 | break; |
3456 | #endif |
3447 | #endif |
3457 | |
3448 | |
|
|
3449 | #if XPM_BACKGROUND |
3458 | case Rxvt_Pixmap: |
3450 | case Rxvt_Pixmap: |
3459 | { |
3451 | { |
3460 | if (*str != ';') |
3452 | if (*str != ';') |
3461 | { |
3453 | { |
3462 | #if XPM_BACKGROUND |
|
|
3463 | scale_pixmap (""); /* reset to default scaling */ |
3454 | bgPixmap.handle_geometry (""); /* reset to default scaling */ |
3464 | set_bgPixmap (str); /* change pixmap */ |
3455 | set_bgPixmap (str); /* change pixmap */ |
3465 | scr_touch (true); |
3456 | scr_touch (true); |
3466 | #endif |
|
|
3467 | } |
3457 | } |
3468 | |
3458 | |
3469 | int changed = 0; |
3459 | int changed = 0; |
3470 | |
3460 | |
3471 | while ((str = strchr (str, ';')) != NULL) |
3461 | while ((str = strchr (str, ';')) != NULL) |
3472 | { |
3462 | { |
3473 | str++; |
3463 | str++; |
3474 | #if XPM_BACKGROUND |
3464 | changed += bgPixmap.handle_geometry (str); |
3475 | changed += scale_pixmap (str); |
|
|
3476 | #endif |
|
|
3477 | } |
3465 | } |
3478 | |
3466 | |
3479 | if (changed) |
3467 | if (changed) |
3480 | { |
3468 | { |
3481 | #ifdef XPM_BACKGROUND |
|
|
3482 | resize_pixmap (); |
3469 | resize_pixmap (); |
3483 | scr_touch (true); |
3470 | scr_touch (true); |
3484 | #endif |
|
|
3485 | } |
3471 | } |
3486 | #if TRANSPARENT && defined(HAVE_AFTERIMAGE) |
3472 | #if ENABLE_TRANSPARENCY && defined(HAVE_AFTERIMAGE) |
3487 | if (option (Opt_transparent)) |
3473 | if (option (Opt_transparent)) |
3488 | check_our_parents (); |
3474 | check_our_parents (); |
3489 | #endif |
3475 | #endif |
3490 | } |
3476 | } |
3491 | break; |
3477 | break; |
|
|
3478 | #endif |
3492 | |
3479 | |
3493 | case Rxvt_restoreFG: |
3480 | case Rxvt_restoreFG: |
3494 | set_window_color (Color_fg, str); |
3481 | set_window_color (Color_fg, str); |
3495 | break; |
3482 | break; |
3496 | case Rxvt_restoreBG: |
3483 | case Rxvt_restoreBG: |