… | |
… | |
867 | #endif |
867 | #endif |
868 | /* nil */ ; |
868 | /* nil */ ; |
869 | } |
869 | } |
870 | } |
870 | } |
871 | |
871 | |
|
|
872 | if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_STRING_LEN, kbuf, len, DT_END))) |
|
|
873 | return; |
|
|
874 | |
872 | if (len <= 0) |
875 | if (len <= 0) |
873 | return; /* not mapped */ |
876 | return; /* not mapped */ |
874 | |
877 | |
875 | if (OPTION (Opt_scrollTtyKeypress)) |
878 | if (OPTION (Opt_scrollTtyKeypress)) |
876 | if (view_start) |
879 | if (view_start) |
… | |
… | |
967 | } |
970 | } |
968 | #endif |
971 | #endif |
969 | |
972 | |
970 | if (want_refresh) |
973 | if (want_refresh) |
971 | { |
974 | { |
|
|
975 | if (SHOULD_INVOKE (HOOK_LINE_UPDATE)) |
|
|
976 | { |
|
|
977 | int row = -view_start; |
|
|
978 | |
|
|
979 | while (row > -nsaved && ROW (row - 1).is_longer ()) |
|
|
980 | --row; |
|
|
981 | |
|
|
982 | while (row < -view_start + nrow) |
|
|
983 | { |
|
|
984 | int start_row = row; |
|
|
985 | line_t *l; |
|
|
986 | |
|
|
987 | do |
|
|
988 | { |
|
|
989 | l = &ROW (row); |
|
|
990 | |
|
|
991 | if (!(l->f & LINE_FILTERED)) |
|
|
992 | { |
|
|
993 | // line not filtered, mark it as filtered |
|
|
994 | l->f |= LINE_FILTERED; |
|
|
995 | while (l->is_longer ()) |
|
|
996 | { |
|
|
997 | l = &ROW (++row); |
|
|
998 | l->f |= LINE_FILTERED; |
|
|
999 | } |
|
|
1000 | |
|
|
1001 | // and filter it |
|
|
1002 | HOOK_INVOKE ((this, HOOK_LINE_UPDATE, DT_INT, start_row, DT_END)); |
|
|
1003 | |
|
|
1004 | break; |
|
|
1005 | } |
|
|
1006 | } |
|
|
1007 | while (l->is_longer ()); |
|
|
1008 | |
|
|
1009 | row++; |
|
|
1010 | } |
|
|
1011 | |
|
|
1012 | } |
|
|
1013 | |
972 | scr_refresh (refresh_type); |
1014 | scr_refresh (refresh_type); |
973 | scrollbar_show (1); |
1015 | scrollbar_show (1); |
974 | #ifdef USE_XIM |
1016 | #ifdef USE_XIM |
975 | IMSendSpot (); |
1017 | IMSendSpot (); |
976 | #endif |
1018 | #endif |
… | |
… | |
1596 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1638 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1597 | break; |
1639 | break; |
1598 | |
1640 | |
1599 | if (ev.xany.window == vt) |
1641 | if (ev.xany.window == vt) |
1600 | { |
1642 | { |
|
|
1643 | if (HOOK_INVOKE ((this, HOOK_MOTION_NOTIFY, DT_XEVENT, &ev, DT_END))) |
|
|
1644 | ; // nop |
1601 | if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
1645 | else if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
1602 | { |
1646 | { |
1603 | while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev)) |
1647 | while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev)) |
1604 | ; |
1648 | ; |
1605 | |
1649 | |
1606 | XQueryPointer (disp, vt, |
1650 | XQueryPointer (disp, vt, |
… | |
… | |
1702 | if (!focus) |
1746 | if (!focus) |
1703 | { |
1747 | { |
1704 | focus = 1; |
1748 | focus = 1; |
1705 | want_refresh = 1; |
1749 | want_refresh = 1; |
1706 | |
1750 | |
1707 | PERL_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1751 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1708 | |
1752 | |
1709 | #if USE_XIM |
1753 | #if USE_XIM |
1710 | if (Input_Context != NULL) |
1754 | if (Input_Context != NULL) |
1711 | { |
1755 | { |
1712 | IMSetStatusPosition (); |
1756 | IMSetStatusPosition (); |
… | |
… | |
1733 | if (focus) |
1777 | if (focus) |
1734 | { |
1778 | { |
1735 | focus = 0; |
1779 | focus = 0; |
1736 | want_refresh = 1; |
1780 | want_refresh = 1; |
1737 | |
1781 | |
1738 | PERL_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1782 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1739 | |
1783 | |
1740 | #if ENABLE_FRILLS || ISO_14755 |
1784 | #if ENABLE_FRILLS || ISO_14755 |
1741 | if (iso14755buf) |
1785 | if (iso14755buf) |
1742 | { |
1786 | { |
1743 | iso14755buf = 0; |
1787 | iso14755buf = 0; |
… | |
… | |
1855 | else |
1899 | else |
1856 | { |
1900 | { |
1857 | if (ev.button != MEvent.button) |
1901 | if (ev.button != MEvent.button) |
1858 | MEvent.clicks = 0; |
1902 | MEvent.clicks = 0; |
1859 | |
1903 | |
1860 | if (!PERL_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END))) |
1904 | if (!HOOK_INVOKE ((this, HOOK_BUTTON_PRESS, DT_XEVENT, &ev, DT_END))) |
1861 | switch (ev.button) |
1905 | switch (ev.button) |
1862 | { |
1906 | { |
1863 | case Button1: |
1907 | case Button1: |
1864 | /* allow meta + click to select rectangular areas */ |
1908 | /* allow meta + click to select rectangular areas */ |
1865 | /* should be done in screen.C */ |
1909 | /* should be done in screen.C */ |
… | |
… | |
2116 | */ |
2160 | */ |
2117 | if (priv_modes & PrivMode_mouse_report |
2161 | if (priv_modes & PrivMode_mouse_report |
2118 | && bypass_keystate |
2162 | && bypass_keystate |
2119 | && ev.button == Button1 && MEvent.clicks <= 1) |
2163 | && ev.button == Button1 && MEvent.clicks <= 1) |
2120 | selection_extend (ev.x, ev.y, 0); |
2164 | selection_extend (ev.x, ev.y, 0); |
|
|
2165 | |
|
|
2166 | if (!HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) |
|
|
2167 | return; |
2121 | |
2168 | |
2122 | switch (ev.button) |
2169 | switch (ev.button) |
2123 | { |
2170 | { |
2124 | case Button1: |
2171 | case Button1: |
2125 | case Button3: |
2172 | case Button3: |
… | |
… | |
2679 | { |
2726 | { |
2680 | if (ch == NOCHAR) |
2727 | if (ch == NOCHAR) |
2681 | { |
2728 | { |
2682 | seq_begin = cmdbuf_ptr; |
2729 | seq_begin = cmdbuf_ptr; |
2683 | ch = next_char (); |
2730 | ch = next_char (); |
2684 | } |
|
|
2685 | |
2731 | |
2686 | if (ch == NOCHAR) // TODO: improve |
2732 | if (ch == NOCHAR) |
2687 | break; |
2733 | break; |
|
|
2734 | } |
2688 | |
2735 | |
2689 | if (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT) |
2736 | if (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT) |
2690 | { |
2737 | { |
2691 | if (!seen_input) |
2738 | if (!seen_input) |
2692 | { |
2739 | { |
… | |
… | |
2733 | } |
2780 | } |
2734 | |
2781 | |
2735 | // scr_add_lines only works for nlines <= nrow - 1. |
2782 | // scr_add_lines only works for nlines <= nrow - 1. |
2736 | if (nlines >= nrow - 1) |
2783 | if (nlines >= nrow - 1) |
2737 | { |
2784 | { |
2738 | if (!PERL_INVOKE ((this, HOOK_ADD_LINES, DT_USTRING_LEN, buf, str - buf, DT_END))) |
2785 | if (!HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_USTRING_LEN, buf, str - buf, DT_END))) |
2739 | scr_add_lines (buf, nlines, str - buf); |
2786 | scr_add_lines (buf, nlines, str - buf); |
2740 | |
2787 | |
2741 | nlines = 0; |
2788 | nlines = 0; |
2742 | str = buf; |
2789 | str = buf; |
2743 | eol = str + min (ncol, UBUFSIZ); |
2790 | eol = str + min (ncol, UBUFSIZ); |
… | |
… | |
2758 | |
2805 | |
2759 | seq_begin = cmdbuf_ptr; |
2806 | seq_begin = cmdbuf_ptr; |
2760 | ch = next_char (); |
2807 | ch = next_char (); |
2761 | } |
2808 | } |
2762 | |
2809 | |
2763 | if (!PERL_INVOKE ((this, HOOK_ADD_LINES, DT_USTRING_LEN, buf, str - buf, DT_END))) |
2810 | if (!HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_USTRING_LEN, buf, str - buf, DT_END))) |
2764 | scr_add_lines (buf, nlines, str - buf); |
2811 | scr_add_lines (buf, nlines, str - buf); |
2765 | |
2812 | |
2766 | /* |
2813 | /* |
2767 | * If there have been a lot of new lines, then update the screen |
2814 | * If there have been a lot of new lines, then update the screen |
2768 | * What the heck I'll cheat and only refresh less than every page-full. |
2815 | * What the heck I'll cheat and only refresh less than every page-full. |
… | |
… | |
3975 | break; |
4022 | break; |
3976 | #endif |
4023 | #endif |
3977 | |
4024 | |
3978 | #if ENABLE_PERL |
4025 | #if ENABLE_PERL |
3979 | case URxvt_perl: |
4026 | case URxvt_perl: |
3980 | if (PERL_INVOKE ((this, HOOK_OSC_SEQ, DT_STRING, str, DT_END))) |
4027 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_STRING, str, DT_END))) |
3981 | ; // no responses yet |
4028 | ; // no responses yet |
3982 | break; |
4029 | break; |
3983 | #endif |
4030 | #endif |
3984 | } |
4031 | } |
3985 | } |
4032 | } |
… | |
… | |
4415 | const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT |
4462 | const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT |
4416 | |
4463 | |
4417 | void |
4464 | void |
4418 | rxvt_term::tt_write (const char *data, unsigned int len) |
4465 | rxvt_term::tt_write (const char *data, unsigned int len) |
4419 | { |
4466 | { |
|
|
4467 | if (pty.pty < 0) |
|
|
4468 | return; |
|
|
4469 | |
4420 | if (v_buflen == 0) |
4470 | if (v_buflen == 0) |
4421 | { |
4471 | { |
4422 | ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE)); |
4472 | ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE)); |
4423 | |
4473 | |
4424 | if ((unsigned int)written == len) |
4474 | if ((unsigned int)written == len) |