… | |
… | |
967 | } |
967 | } |
968 | #endif |
968 | #endif |
969 | |
969 | |
970 | if (want_refresh) |
970 | if (want_refresh) |
971 | { |
971 | { |
|
|
972 | if (SHOULD_INVOKE (HOOK_LINE_UPDATE)) |
|
|
973 | { |
|
|
974 | int row = -view_start; |
|
|
975 | |
|
|
976 | while (row > -nsaved && ROW (row - 1).is_longer ()) |
|
|
977 | --row; |
|
|
978 | |
|
|
979 | while (row < -view_start + nrow) |
|
|
980 | { |
|
|
981 | int start_row = row; |
|
|
982 | line_t *l; |
|
|
983 | |
|
|
984 | do |
|
|
985 | { |
|
|
986 | l = &ROW (row); |
|
|
987 | |
|
|
988 | if (!(l->f & LINE_FILTERED)) |
|
|
989 | { |
|
|
990 | // line not filtered, mark it as filtered |
|
|
991 | l->f |= LINE_FILTERED; |
|
|
992 | while (l->is_longer ()) |
|
|
993 | { |
|
|
994 | l = &ROW (++row); |
|
|
995 | l->f |= LINE_FILTERED; |
|
|
996 | } |
|
|
997 | |
|
|
998 | // and filter it |
|
|
999 | HOOK_INVOKE ((this, HOOK_LINE_UPDATE, DT_INT, start_row, DT_END)); |
|
|
1000 | |
|
|
1001 | break; |
|
|
1002 | } |
|
|
1003 | } |
|
|
1004 | while (l->is_longer ()); |
|
|
1005 | |
|
|
1006 | row++; |
|
|
1007 | } |
|
|
1008 | |
|
|
1009 | } |
|
|
1010 | |
972 | scr_refresh (refresh_type); |
1011 | scr_refresh (refresh_type); |
973 | scrollbar_show (1); |
1012 | scrollbar_show (1); |
974 | #ifdef USE_XIM |
1013 | #ifdef USE_XIM |
975 | IMSendSpot (); |
1014 | IMSendSpot (); |
976 | #endif |
1015 | #endif |
… | |
… | |
1702 | if (!focus) |
1741 | if (!focus) |
1703 | { |
1742 | { |
1704 | focus = 1; |
1743 | focus = 1; |
1705 | want_refresh = 1; |
1744 | want_refresh = 1; |
1706 | |
1745 | |
1707 | PERL_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1746 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1708 | |
1747 | |
1709 | #if USE_XIM |
1748 | #if USE_XIM |
1710 | if (Input_Context != NULL) |
1749 | if (Input_Context != NULL) |
1711 | { |
1750 | { |
1712 | IMSetStatusPosition (); |
1751 | IMSetStatusPosition (); |
… | |
… | |
1733 | if (focus) |
1772 | if (focus) |
1734 | { |
1773 | { |
1735 | focus = 0; |
1774 | focus = 0; |
1736 | want_refresh = 1; |
1775 | want_refresh = 1; |
1737 | |
1776 | |
1738 | PERL_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1777 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1739 | |
1778 | |
1740 | #if ENABLE_FRILLS || ISO_14755 |
1779 | #if ENABLE_FRILLS || ISO_14755 |
1741 | if (iso14755buf) |
1780 | if (iso14755buf) |
1742 | { |
1781 | { |
1743 | iso14755buf = 0; |
1782 | iso14755buf = 0; |
… | |
… | |
1855 | else |
1894 | else |
1856 | { |
1895 | { |
1857 | if (ev.button != MEvent.button) |
1896 | if (ev.button != MEvent.button) |
1858 | MEvent.clicks = 0; |
1897 | MEvent.clicks = 0; |
1859 | |
1898 | |
1860 | if (!PERL_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END))) |
1899 | if (!HOOK_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END))) |
1861 | switch (ev.button) |
1900 | switch (ev.button) |
1862 | { |
1901 | { |
1863 | case Button1: |
1902 | case Button1: |
1864 | /* allow meta + click to select rectangular areas */ |
1903 | /* allow meta + click to select rectangular areas */ |
1865 | /* should be done in screen.C */ |
1904 | /* should be done in screen.C */ |
… | |
… | |
2679 | { |
2718 | { |
2680 | if (ch == NOCHAR) |
2719 | if (ch == NOCHAR) |
2681 | { |
2720 | { |
2682 | seq_begin = cmdbuf_ptr; |
2721 | seq_begin = cmdbuf_ptr; |
2683 | ch = next_char (); |
2722 | ch = next_char (); |
2684 | } |
|
|
2685 | |
2723 | |
2686 | if (ch == NOCHAR) // TODO: improve |
2724 | if (ch == NOCHAR) |
2687 | break; |
2725 | break; |
|
|
2726 | } |
2688 | |
2727 | |
2689 | if (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT) |
2728 | if (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT) |
2690 | { |
2729 | { |
2691 | if (!seen_input) |
2730 | if (!seen_input) |
2692 | { |
2731 | { |
… | |
… | |
2733 | } |
2772 | } |
2734 | |
2773 | |
2735 | // scr_add_lines only works for nlines <= nrow - 1. |
2774 | // scr_add_lines only works for nlines <= nrow - 1. |
2736 | if (nlines >= nrow - 1) |
2775 | if (nlines >= nrow - 1) |
2737 | { |
2776 | { |
2738 | if (!PERL_INVOKE ((this, HOOK_ADD_LINES, DT_USTRING_LEN, buf, str - buf, DT_END))) |
2777 | if (!HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_USTRING_LEN, buf, str - buf, DT_END))) |
2739 | scr_add_lines (buf, nlines, str - buf); |
2778 | scr_add_lines (buf, nlines, str - buf); |
2740 | |
2779 | |
2741 | nlines = 0; |
2780 | nlines = 0; |
2742 | str = buf; |
2781 | str = buf; |
2743 | eol = str + min (ncol, UBUFSIZ); |
2782 | eol = str + min (ncol, UBUFSIZ); |
… | |
… | |
2758 | |
2797 | |
2759 | seq_begin = cmdbuf_ptr; |
2798 | seq_begin = cmdbuf_ptr; |
2760 | ch = next_char (); |
2799 | ch = next_char (); |
2761 | } |
2800 | } |
2762 | |
2801 | |
2763 | if (!PERL_INVOKE ((this, HOOK_ADD_LINES, DT_USTRING_LEN, buf, str - buf, DT_END))) |
2802 | if (!HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_USTRING_LEN, buf, str - buf, DT_END))) |
2764 | scr_add_lines (buf, nlines, str - buf); |
2803 | scr_add_lines (buf, nlines, str - buf); |
2765 | |
2804 | |
2766 | /* |
2805 | /* |
2767 | * If there have been a lot of new lines, then update the screen |
2806 | * 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. |
2807 | * What the heck I'll cheat and only refresh less than every page-full. |
… | |
… | |
3975 | break; |
4014 | break; |
3976 | #endif |
4015 | #endif |
3977 | |
4016 | |
3978 | #if ENABLE_PERL |
4017 | #if ENABLE_PERL |
3979 | case URxvt_perl: |
4018 | case URxvt_perl: |
3980 | if (PERL_INVOKE ((this, HOOK_OSC_SEQ, DT_STRING, str, DT_END))) |
4019 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_STRING, str, DT_END))) |
3981 | ; // no responses yet |
4020 | ; // no responses yet |
3982 | break; |
4021 | break; |
3983 | #endif |
4022 | #endif |
3984 | } |
4023 | } |
3985 | } |
4024 | } |
… | |
… | |
4415 | const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT |
4454 | const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT |
4416 | |
4455 | |
4417 | void |
4456 | void |
4418 | rxvt_term::tt_write (const char *data, unsigned int len) |
4457 | rxvt_term::tt_write (const char *data, unsigned int len) |
4419 | { |
4458 | { |
|
|
4459 | if (pty.pty < 0) |
|
|
4460 | return; |
|
|
4461 | |
4420 | if (v_buflen == 0) |
4462 | if (v_buflen == 0) |
4421 | { |
4463 | { |
4422 | ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE)); |
4464 | ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE)); |
4423 | |
4465 | |
4424 | if ((unsigned int)written == len) |
4466 | if ((unsigned int)written == len) |