… | |
… | |
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 |
541 | |
541 | |
542 | #ifdef PRINTPIPE |
542 | #ifdef PRINTPIPE |
543 | if (keysym == XK_Print) |
543 | if (keysym == XK_Print) |
544 | { |
544 | { |
545 | scr_printscreen (ctrl | shft); |
545 | scr_printscreen (ctrl | shft); |
546 | return; |
546 | return; |
… | |
… | |
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 |
… | |
… | |
1186 | |
1185 | |
1187 | #if LINUX_YIELD_HACK |
1186 | #if LINUX_YIELD_HACK |
1188 | static struct event_handler |
1187 | static struct event_handler |
1189 | { |
1188 | { |
1190 | check_watcher yield_ev; |
1189 | check_watcher yield_ev; |
1191 | |
1190 | |
1192 | void yield_cb (check_watcher &w) |
1191 | void yield_cb (check_watcher &w) |
1193 | { |
1192 | { |
1194 | // this should really be sched_yield(), but the linux guys thought |
1193 | // this should really be sched_yield(), but the linux guys thought |
1195 | // that giving a process calling sched_yield () less cpu time than |
1194 | // that giving a process calling sched_yield () less cpu time than |
1196 | // ones with high nice levels is a useful thing to do. It surely is is |
1195 | // ones with high nice levels is a useful thing to do. It surely is is |
… | |
… | |
1243 | pty_ev.stop (); |
1242 | pty_ev.stop (); |
1244 | |
1243 | |
1245 | if (!option (Opt_hold)) |
1244 | if (!option (Opt_hold)) |
1246 | destroy (); |
1245 | destroy (); |
1247 | } |
1246 | } |
1248 | |
1247 | |
1249 | return false; |
1248 | return false; |
1250 | } |
1249 | } |
1251 | |
1250 | |
1252 | void |
1251 | void |
1253 | rxvt_term::pty_cb (io_watcher &w, short revents) |
1252 | rxvt_term::pty_cb (io_watcher &w, short revents) |
… | |
… | |
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: |
… | |
… | |
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 XPM_BACKGROUND |
1495 | if (!option(Opt_transparent) && bgPixmap.auto_resize) |
1490 | if (!option (Opt_transparent) && bgPixmap.auto_resize) |
1496 | { |
1491 | { |
1497 | resize_pixmap (); |
1492 | resize_pixmap (); |
1498 | scr_touch (true); |
1493 | scr_touch (true); |
1499 | } |
1494 | } |
1500 | #endif |
1495 | #endif |
1501 | } |
1496 | } |
1502 | |
1497 | |
1503 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1498 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1504 | |
1499 | |
1505 | #ifdef TRANSPARENT |
1500 | #ifdef ENABLE_TRANSPARENCY |
1506 | if (option (Opt_transparent)) |
1501 | if (option (Opt_transparent)) |
1507 | check_our_parents (); |
1502 | check_our_parents (); |
1508 | #endif |
1503 | #endif |
1509 | } |
1504 | } |
1510 | break; |
1505 | break; |
… | |
… | |
1544 | text_blink_ev.stop (); |
1539 | text_blink_ev.stop (); |
1545 | #endif |
1540 | #endif |
1546 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1541 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1547 | break; |
1542 | break; |
1548 | |
1543 | |
1549 | #ifdef TRANSPARENT |
1544 | #ifdef ENABLE_TRANSPARENCY |
1550 | case ReparentNotify: |
1545 | case ReparentNotify: |
1551 | rootwin_cb (ev); |
1546 | rootwin_cb (ev); |
1552 | break; |
1547 | break; |
1553 | #endif /* TRANSPARENT */ |
1548 | #endif /* ENABLE_TRANSPARENCY */ |
1554 | |
1549 | |
1555 | case GraphicsExpose: |
1550 | case GraphicsExpose: |
1556 | case Expose: |
1551 | case Expose: |
1557 | if (ev.xany.window == vt) |
1552 | if (ev.xany.window == vt) |
1558 | { |
1553 | { |
… | |
… | |
1582 | { |
1577 | { |
1583 | scrollBar.setIdle (); |
1578 | scrollBar.setIdle (); |
1584 | scrollbar_show (0); |
1579 | scrollbar_show (0); |
1585 | } |
1580 | } |
1586 | |
1581 | |
1587 | #ifdef TRANSPARENT |
1582 | #ifdef ENABLE_TRANSPARENCY |
1588 | if (am_transparent && ev.xany.window == parent[0]) |
1583 | if (am_transparent && ev.xany.window == parent[0]) |
1589 | XClearWindow (dpy, ev.xany.window); |
1584 | XClearWindow (dpy, ev.xany.window); |
1590 | #endif |
1585 | #endif |
1591 | } |
1586 | } |
1592 | break; |
1587 | break; |
… | |
… | |
1693 | &ev.xbutton.x, &ev.xbutton.y, |
1688 | &ev.xbutton.x, &ev.xbutton.y, |
1694 | &unused_mask); |
1689 | &unused_mask); |
1695 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1690 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1696 | scrollbar_size ()); |
1691 | scrollbar_size ()); |
1697 | want_refresh = 1; |
1692 | want_refresh = 1; |
1698 | refresh_limit = 0; |
|
|
1699 | scrollbar_show (1); |
1693 | scrollbar_show (1); |
1700 | } |
1694 | } |
1701 | break; |
1695 | break; |
1702 | } |
1696 | } |
1703 | |
1697 | |
… | |
… | |
1785 | |
1779 | |
1786 | #if ENABLE_FRILLS || ISO_14755 |
1780 | #if ENABLE_FRILLS || ISO_14755 |
1787 | if (iso14755buf) |
1781 | if (iso14755buf) |
1788 | { |
1782 | { |
1789 | iso14755buf = 0; |
1783 | iso14755buf = 0; |
1790 | # if ENABLE_OVERLAY |
1784 | # if ISO_14755 |
1791 | scr_overlay_off (); |
1785 | scr_overlay_off (); |
1792 | # endif |
1786 | # endif |
1793 | } |
1787 | } |
1794 | #endif |
1788 | #endif |
1795 | #if USE_XIM |
1789 | #if USE_XIM |
… | |
… | |
1822 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1816 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1823 | } |
1817 | } |
1824 | #endif |
1818 | #endif |
1825 | } |
1819 | } |
1826 | |
1820 | |
1827 | #if TRANSPARENT || ENABLE_PERL |
1821 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1828 | void |
1822 | void |
1829 | rxvt_term::rootwin_cb (XEvent &ev) |
1823 | rxvt_term::rootwin_cb (XEvent &ev) |
1830 | { |
1824 | { |
1831 | make_current (); |
1825 | make_current (); |
1832 | |
1826 | |
1833 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1827 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1834 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
1828 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
1835 | return; |
1829 | return; |
1836 | |
1830 | |
1837 | # if TRANSPARENT |
1831 | # if ENABLE_TRANSPARENCY |
1838 | switch (ev.type) |
1832 | switch (ev.type) |
1839 | { |
1833 | { |
1840 | case PropertyNotify: |
1834 | case PropertyNotify: |
1841 | /* |
1835 | /* |
1842 | * if user used some Esetroot compatible prog to set the root bg, |
1836 | * if user used some Esetroot compatible prog to set the root bg, |
… | |
… | |
2291 | if (ch == C0_LF) |
2285 | if (ch == C0_LF) |
2292 | nlines++; |
2286 | nlines++; |
2293 | |
2287 | |
2294 | refresh_count++; |
2288 | refresh_count++; |
2295 | |
2289 | |
2296 | if (!option (Opt_jumpScroll) |
2290 | if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) |
2297 | || (refresh_count >= refresh_limit * (nrow - 1))) |
|
|
2298 | { |
2291 | { |
2299 | refreshnow = true; |
|
|
2300 | refresh_count = 0; |
2292 | refresh_count = 0; |
|
|
2293 | |
|
|
2294 | if (!option (Opt_skipScroll) || io_manager::now () > NOW + 1. / 60.) |
|
|
2295 | { |
|
|
2296 | refreshnow = true; |
2301 | ch = NOCHAR; |
2297 | ch = NOCHAR; |
2302 | break; |
2298 | break; |
|
|
2299 | } |
2303 | } |
2300 | } |
2304 | |
2301 | |
2305 | // scr_add_lines only works for nlines <= nrow - 1. |
2302 | // scr_add_lines only works for nlines <= nrow - 1. |
2306 | if (nlines >= nrow - 1) |
2303 | if (nlines >= nrow - 1) |
2307 | { |
2304 | { |
… | |
… | |
2335 | && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) |
2332 | && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) |
2336 | scr_add_lines (buf, str - buf, nlines); |
2333 | scr_add_lines (buf, str - buf, nlines); |
2337 | |
2334 | |
2338 | /* |
2335 | /* |
2339 | * If there have been a lot of new lines, then update the screen |
2336 | * 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. |
2337 | * 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 |
2338 | * if skipScroll is enabled. |
2342 | * is incremented here because we must be doing flat-out scrolling. |
|
|
2343 | */ |
2339 | */ |
2344 | if (refreshnow) |
2340 | if (refreshnow) |
2345 | { |
2341 | { |
2346 | if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
|
|
2347 | refresh_limit++; |
|
|
2348 | else |
|
|
2349 | { |
|
|
2350 | flag = true; |
2342 | flag = true; |
2351 | //TODO: due to popular request, implement "skipscroll" option here |
|
|
2352 | scr_refresh (); |
2343 | scr_refresh (); |
2353 | want_refresh = 1; |
2344 | want_refresh = 1; |
2354 | } |
|
|
2355 | } |
2345 | } |
2356 | |
2346 | |
2357 | } |
2347 | } |
2358 | else |
2348 | else |
2359 | { |
2349 | { |
… | |
… | |
2508 | { |
2498 | { |
2509 | if ((buf[len++] = cmd_getc ()) == 'i') |
2499 | if ((buf[len++] = cmd_getc ()) == 'i') |
2510 | break; /* done = 1 */ |
2500 | break; /* done = 1 */ |
2511 | } |
2501 | } |
2512 | } |
2502 | } |
2513 | |
2503 | |
2514 | for (i = 0; i < len; i++) |
2504 | for (i = 0; i < len; i++) |
2515 | if (putc (buf[i], fd) == EOF) |
2505 | if (putc (buf[i], fd) == EOF) |
2516 | { |
2506 | { |
2517 | done = 1; |
2507 | done = 1; |
2518 | break; |
2508 | break; |
… | |
… | |
2580 | process_dcs_seq (); |
2570 | process_dcs_seq (); |
2581 | break; |
2571 | break; |
2582 | case 0x9b: /* CSI */ |
2572 | case 0x9b: /* CSI */ |
2583 | process_csi_seq (); |
2573 | process_csi_seq (); |
2584 | break; |
2574 | break; |
2585 | case 0x9d: /* CSI */ |
2575 | case 0x9d: /* OSC */ |
2586 | process_osc_seq (); |
2576 | process_osc_seq (); |
2587 | break; |
2577 | break; |
2588 | #endif |
2578 | #endif |
2589 | } |
2579 | } |
2590 | } |
2580 | } |
… | |
… | |
2818 | unicode_t ch, priv, i; |
2808 | unicode_t ch, priv, i; |
2819 | unsigned int nargs, p; |
2809 | unsigned int nargs, p; |
2820 | int n, ndef; |
2810 | int n, ndef; |
2821 | int arg[ESC_ARGS]; |
2811 | int arg[ESC_ARGS]; |
2822 | |
2812 | |
2823 | for (nargs = ESC_ARGS; nargs > 0;) |
2813 | memset (arg, 0, sizeof (arg)); |
2824 | arg[--nargs] = 0; |
2814 | nargs = 0; |
2825 | |
2815 | |
2826 | priv = 0; |
2816 | priv = 0; |
2827 | ch = cmd_getc (); |
2817 | ch = cmd_getc (); |
2828 | if (ch >= '<' && ch <= '?') |
2818 | if (ch >= '<' && ch <= '?') |
2829 | { /* '<' '=' '>' '?' */ |
2819 | { /* '<' '=' '>' '?' */ |
… | |
… | |
2873 | switch (priv) |
2863 | switch (priv) |
2874 | { |
2864 | { |
2875 | case '>': |
2865 | case '>': |
2876 | if (ch == CSI_DA) /* secondary device attributes */ |
2866 | if (ch == CSI_DA) /* secondary device attributes */ |
2877 | { |
2867 | { |
2878 | // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, |
2868 | // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt, |
2879 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2869 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2880 | // |
2870 | // |
2881 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2871 | // 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 |
2872 | // 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). |
2873 | // that we do not support xterm mouse reporting (should be 95 when we do). |
… | |
… | |
3336 | int saveop = op; |
3326 | int saveop = op; |
3337 | |
3327 | |
3338 | dLocal (Display *, dpy); |
3328 | dLocal (Display *, dpy); |
3339 | |
3329 | |
3340 | assert (str != NULL); |
3330 | assert (str != NULL); |
3341 | |
3331 | |
3342 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3332 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3343 | return; |
3333 | return; |
3344 | |
3334 | |
3345 | switch (op) |
3335 | switch (op) |
3346 | { |
3336 | { |
… | |
… | |
3441 | break; |
3431 | break; |
3442 | case URxvt_Color_IT: |
3432 | case URxvt_Color_IT: |
3443 | process_color_seq (op, Color_IT, str, resp); |
3433 | process_color_seq (op, Color_IT, str, resp); |
3444 | break; |
3434 | break; |
3445 | #endif |
3435 | #endif |
3446 | #if TRANSPARENT && TINTING |
3436 | #if ENABLE_TRANSPARENCY && TINTING |
3447 | case URxvt_Color_tint: |
3437 | case URxvt_Color_tint: |
3448 | process_color_seq (op, Color_tint, str, resp); |
3438 | process_color_seq (op, Color_tint, str, resp); |
3449 | |
3439 | |
3450 | check_our_parents (); |
3440 | check_our_parents (); |
3451 | |
3441 | |
… | |
… | |
3481 | #ifdef XPM_BACKGROUND |
3471 | #ifdef XPM_BACKGROUND |
3482 | resize_pixmap (); |
3472 | resize_pixmap (); |
3483 | scr_touch (true); |
3473 | scr_touch (true); |
3484 | #endif |
3474 | #endif |
3485 | } |
3475 | } |
3486 | #if TRANSPARENT && defined(HAVE_AFTERIMAGE) |
3476 | #if ENABLE_TRANSPARENCY && defined(HAVE_AFTERIMAGE) |
3487 | if (option(Opt_transparent)) |
3477 | if (option (Opt_transparent)) |
3488 | check_our_parents (); |
3478 | check_our_parents (); |
3489 | #endif |
3479 | #endif |
3490 | |
|
|
3491 | } |
3480 | } |
3492 | break; |
3481 | break; |
3493 | |
3482 | |
3494 | case Rxvt_restoreFG: |
3483 | case Rxvt_restoreFG: |
3495 | set_window_color (Color_fg, str); |
3484 | set_window_color (Color_fg, str); |