… | |
… | |
43 | * along with this program; if not, write to the Free Software |
43 | * along with this program; if not, write to the Free Software |
44 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
44 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
45 | *----------------------------------------------------------------------*/ |
45 | *----------------------------------------------------------------------*/ |
46 | |
46 | |
47 | /*{{{ includes: */ |
47 | /*{{{ includes: */ |
48 | #include "../config.h" /* NECESSARY */ |
48 | #include "../config.h" |
49 | #include "rxvt.h" /* NECESSARY */ |
49 | #include "rxvt.h" |
|
|
50 | #include "rxvtperl.h" |
50 | #include "version.h" |
51 | #include "version.h" |
51 | #include "command.h" |
52 | #include "command.h" |
|
|
53 | |
|
|
54 | #if HAVE_SCHED_YIELD |
|
|
55 | # include <sched.h> |
|
|
56 | #endif |
52 | |
57 | |
53 | #ifdef KEYSYM_RESOURCE |
58 | #ifdef KEYSYM_RESOURCE |
54 | # include "keyboard.h" |
59 | # include "keyboard.h" |
55 | #endif |
60 | #endif |
56 | |
61 | |
… | |
… | |
155 | } |
160 | } |
156 | |
161 | |
157 | x--; |
162 | x--; |
158 | } |
163 | } |
159 | } |
164 | } |
160 | #endif |
|
|
161 | |
165 | |
162 | void |
166 | void |
163 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
167 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
164 | { |
168 | { |
165 | #if ENABLE_OVERLAY |
|
|
166 | rxvt_fontset *fs = FONTSET (r); |
169 | rxvt_fontset *fs = FONTSET (r); |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
170 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
171 | wchar_t *chr, *alloc, ch2, *fname; |
169 | int len; |
172 | int len; |
170 | |
173 | |
… | |
… | |
189 | |
192 | |
190 | char attr[80]; // plenty |
193 | char attr[80]; // plenty |
191 | |
194 | |
192 | sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", |
195 | sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", |
193 | (int)r, |
196 | (int)r, |
194 | GET_FGCOLOR (r), GET_BGCOLOR (r), |
197 | fgcolor_of (r), bgcolor_of (r), |
195 | r & RS_Bold ? " bold" : "", |
198 | r & RS_Bold ? " bold" : "", |
196 | r & RS_Italic ? " italic" : "", |
199 | r & RS_Italic ? " italic" : "", |
197 | r & RS_Blink ? " blink" : "", |
200 | r & RS_Blink ? " blink" : "", |
198 | r & RS_RVid ? " rvid" : "", |
201 | r & RS_RVid ? " rvid" : "", |
199 | r & RS_Uline ? " uline" : "", |
202 | r & RS_Uline ? " uline" : "", |
… | |
… | |
238 | |
241 | |
239 | # if ENABLE_COMBINING |
242 | # if ENABLE_COMBINING |
240 | if (alloc) |
243 | if (alloc) |
241 | delete [] alloc; |
244 | delete [] alloc; |
242 | # endif |
245 | # endif |
243 | #endif |
|
|
244 | } |
246 | } |
|
|
247 | #endif |
245 | |
248 | |
246 | void |
249 | void |
247 | rxvt_term::commit_iso14755 () |
250 | rxvt_term::commit_iso14755 () |
248 | { |
251 | { |
249 | wchar_t ch[2]; |
252 | wchar_t ch[2]; |
… | |
… | |
866 | } |
869 | } |
867 | |
870 | |
868 | if (len <= 0) |
871 | if (len <= 0) |
869 | return; /* not mapped */ |
872 | return; /* not mapped */ |
870 | |
873 | |
871 | if (options & Opt_scrollTtyKeypress) |
874 | if (OPTION (Opt_scrollTtyKeypress)) |
872 | if (view_start) |
875 | if (view_start) |
873 | { |
876 | { |
874 | view_start = 0; |
877 | view_start = 0; |
875 | want_refresh = 1; |
878 | want_refresh = 1; |
876 | } |
879 | } |
… | |
… | |
982 | SET_LOCALE (locale); |
985 | SET_LOCALE (locale); |
983 | |
986 | |
984 | display->flush (); |
987 | display->flush (); |
985 | |
988 | |
986 | if (want_refresh && !flush_ev.active) |
989 | if (want_refresh && !flush_ev.active) |
987 | flush_ev.start (NOW + 0.01); |
990 | flush_ev.start (NOW + 1. / 60.); // refresh at max. 60 hz normally |
988 | } |
991 | } |
989 | |
992 | |
990 | void |
993 | void |
991 | rxvt_term::flush_cb (time_watcher &w) |
994 | rxvt_term::flush_cb (time_watcher &w) |
992 | { |
995 | { |
… | |
… | |
1067 | w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); |
1070 | w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); |
1068 | } |
1071 | } |
1069 | } |
1072 | } |
1070 | #endif |
1073 | #endif |
1071 | |
1074 | |
|
|
1075 | #if HAVE_SCHED_YIELD |
|
|
1076 | static struct event_handler |
|
|
1077 | { |
|
|
1078 | check_watcher cw_yield; |
|
|
1079 | |
|
|
1080 | void yield (check_watcher &w) |
|
|
1081 | { |
|
|
1082 | sched_yield (); |
|
|
1083 | w.stop (); |
|
|
1084 | } |
|
|
1085 | |
|
|
1086 | event_handler () |
|
|
1087 | : cw_yield (this, &event_handler::yield) |
|
|
1088 | { |
|
|
1089 | } |
|
|
1090 | } event_handler; |
|
|
1091 | #endif |
|
|
1092 | |
1072 | bool |
1093 | bool |
1073 | rxvt_term::pty_fill () |
1094 | rxvt_term::pty_fill () |
1074 | { |
1095 | { |
1075 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
1096 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
1076 | |
1097 | |
… | |
… | |
1082 | |
1103 | |
1083 | memmove (cmdbuf_base, cmdbuf_ptr, n); |
1104 | memmove (cmdbuf_base, cmdbuf_ptr, n); |
1084 | cmdbuf_ptr = cmdbuf_base; |
1105 | cmdbuf_ptr = cmdbuf_base; |
1085 | cmdbuf_endp = cmdbuf_ptr + n; |
1106 | cmdbuf_endp = cmdbuf_ptr + n; |
1086 | |
1107 | |
1087 | n = read (pty.pty, cmdbuf_endp, CBUFSIZ - n); |
1108 | ssize_t r = read (pty.pty, cmdbuf_endp, CBUFSIZ - n); |
1088 | |
1109 | |
1089 | if (n > 0) |
1110 | if (r > 0) |
1090 | { |
1111 | { |
1091 | cmdbuf_endp += n; |
1112 | cmdbuf_endp += r; |
1092 | return true; |
1113 | return true; |
1093 | } |
1114 | } |
1094 | else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0) |
1115 | else if (r < 0 && (errno == EAGAIN || errno == EINTR)) |
|
|
1116 | { |
|
|
1117 | #if HAVE_SCHED_YIELD |
|
|
1118 | if (display->is_local) |
|
|
1119 | event_handler.cw_yield.start (); |
|
|
1120 | #endif |
|
|
1121 | } |
|
|
1122 | else |
1095 | { |
1123 | { |
1096 | pty_ev.stop (); |
1124 | pty_ev.stop (); |
1097 | |
1125 | |
1098 | if (!(options & Opt_hold)) |
1126 | if (!OPTION (Opt_hold)) |
1099 | destroy (); |
1127 | destroy (); |
1100 | } |
1128 | } |
1101 | |
1129 | |
1102 | return false; |
1130 | return false; |
1103 | } |
1131 | } |
… | |
… | |
1125 | recolour_cursor (); |
1153 | recolour_cursor (); |
1126 | |
1154 | |
1127 | #ifdef POINTER_BLANK |
1155 | #ifdef POINTER_BLANK |
1128 | hidden_pointer = 0; |
1156 | hidden_pointer = 0; |
1129 | |
1157 | |
1130 | if (options & Opt_pointerBlank) |
1158 | if (OPTION (Opt_pointerBlank)) |
1131 | pointer_ev.start (NOW + pointerBlankDelay); |
1159 | pointer_ev.start (NOW + pointerBlankDelay); |
1132 | #endif |
1160 | #endif |
1133 | } |
1161 | } |
1134 | |
1162 | |
1135 | #ifdef POINTER_BLANK |
1163 | #ifdef POINTER_BLANK |
1136 | void |
1164 | void |
1137 | rxvt_term::pointer_blank () |
1165 | rxvt_term::pointer_blank () |
1138 | { |
1166 | { |
1139 | if (! (options & Opt_pointerBlank)) |
1167 | if (! OPTION (Opt_pointerBlank)) |
1140 | return; |
1168 | return; |
1141 | |
1169 | |
1142 | XDefineCursor (display->display, vt, display->blank_cursor); |
1170 | XDefineCursor (display->display, vt, display->blank_cursor); |
1143 | XFlush (display->display); |
1171 | XFlush (display->display); |
1144 | |
1172 | |
… | |
… | |
1242 | |
1270 | |
1243 | SET_R (this); |
1271 | SET_R (this); |
1244 | SET_LOCALE (locale); |
1272 | SET_LOCALE (locale); |
1245 | |
1273 | |
1246 | #if defined(CURSOR_BLINK) |
1274 | #if defined(CURSOR_BLINK) |
1247 | if ((options & Opt_cursorBlink) && ev.type == KeyPress) |
1275 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1248 | { |
1276 | { |
1249 | if (hidden_cursor) |
1277 | if (hidden_cursor) |
1250 | { |
1278 | { |
1251 | hidden_cursor = 0; |
1279 | hidden_cursor = 0; |
1252 | want_refresh = 1; |
1280 | want_refresh = 1; |
… | |
… | |
1255 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1283 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1256 | } |
1284 | } |
1257 | #endif |
1285 | #endif |
1258 | |
1286 | |
1259 | #if defined(POINTER_BLANK) |
1287 | #if defined(POINTER_BLANK) |
1260 | if ((options & Opt_pointerBlank) && pointerBlankDelay > 0) |
1288 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1261 | { |
1289 | { |
1262 | if (ev.type == MotionNotify |
1290 | if (ev.type == MotionNotify |
1263 | || ev.type == ButtonPress |
1291 | || ev.type == ButtonPress |
1264 | || ev.type == ButtonRelease) |
1292 | || ev.type == ButtonRelease) |
1265 | if (hidden_pointer) |
1293 | if (hidden_pointer) |
… | |
… | |
1461 | seen_resize = 1; |
1489 | seen_resize = 1; |
1462 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1490 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1463 | } |
1491 | } |
1464 | |
1492 | |
1465 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1493 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1466 | if (options & Opt_transparent) |
1494 | if (OPTION (Opt_transparent)) |
1467 | check_our_parents (); |
1495 | check_our_parents (); |
1468 | #endif |
1496 | #endif |
1469 | } |
1497 | } |
1470 | break; |
1498 | break; |
1471 | |
1499 | |
… | |
… | |
1672 | { |
1700 | { |
1673 | if (!focus) |
1701 | if (!focus) |
1674 | { |
1702 | { |
1675 | focus = 1; |
1703 | focus = 1; |
1676 | want_refresh = 1; |
1704 | want_refresh = 1; |
|
|
1705 | |
|
|
1706 | PERL_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
|
|
1707 | |
1677 | #if USE_XIM |
1708 | #if USE_XIM |
1678 | if (Input_Context != NULL) |
1709 | if (Input_Context != NULL) |
1679 | { |
1710 | { |
1680 | IMSetStatusPosition (); |
1711 | IMSetStatusPosition (); |
1681 | XSetICFocus (Input_Context); |
1712 | XSetICFocus (Input_Context); |
1682 | } |
1713 | } |
1683 | #endif |
1714 | #endif |
1684 | #if CURSOR_BLINK |
1715 | #if CURSOR_BLINK |
1685 | if (options & Opt_cursorBlink) |
1716 | if (OPTION (Opt_cursorBlink)) |
1686 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1717 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1687 | #endif |
1718 | #endif |
1688 | #if OFF_FOCUS_FADING |
1719 | #if OFF_FOCUS_FADING |
1689 | if (rs[Rs_fade]) |
1720 | if (rs[Rs_fade]) |
1690 | { |
1721 | { |
… | |
… | |
1701 | if (focus) |
1732 | if (focus) |
1702 | { |
1733 | { |
1703 | focus = 0; |
1734 | focus = 0; |
1704 | want_refresh = 1; |
1735 | want_refresh = 1; |
1705 | |
1736 | |
|
|
1737 | PERL_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
|
|
1738 | |
1706 | #if ENABLE_FRILLS || ISO_14755 |
1739 | #if ENABLE_FRILLS || ISO_14755 |
|
|
1740 | if (iso14755buf) |
|
|
1741 | { |
1707 | iso14755buf = 0; |
1742 | iso14755buf = 0; |
1708 | #endif |
|
|
1709 | #if ENABLE_OVERLAY |
1743 | # if ENABLE_OVERLAY |
1710 | scr_overlay_off (); |
1744 | scr_overlay_off (); |
|
|
1745 | # endif |
|
|
1746 | } |
1711 | #endif |
1747 | #endif |
1712 | #if USE_XIM |
1748 | #if USE_XIM |
1713 | if (Input_Context != NULL) |
1749 | if (Input_Context != NULL) |
1714 | XUnsetICFocus (Input_Context); |
1750 | XUnsetICFocus (Input_Context); |
1715 | #endif |
1751 | #endif |
1716 | #if CURSOR_BLINK |
1752 | #if CURSOR_BLINK |
1717 | if (options & Opt_cursorBlink) |
1753 | if (OPTION (Opt_cursorBlink)) |
1718 | cursor_blink_ev.stop (); |
1754 | cursor_blink_ev.stop (); |
1719 | hidden_cursor = 0; |
1755 | hidden_cursor = 0; |
1720 | #endif |
1756 | #endif |
1721 | #if OFF_FOCUS_FADING |
1757 | #if OFF_FOCUS_FADING |
1722 | if (rs[Rs_fade]) |
1758 | if (rs[Rs_fade]) |
… | |
… | |
1746 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1782 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1747 | return; |
1783 | return; |
1748 | |
1784 | |
1749 | /* FALLTHROUGH */ |
1785 | /* FALLTHROUGH */ |
1750 | case ReparentNotify: |
1786 | case ReparentNotify: |
1751 | if ((options & Opt_transparent) && check_our_parents () && am_transparent) |
1787 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1752 | want_refresh = want_full_refresh = 1; |
1788 | want_refresh = want_full_refresh = 1; |
1753 | break; |
1789 | break; |
1754 | } |
1790 | } |
1755 | } |
1791 | } |
1756 | #endif |
1792 | #endif |
… | |
… | |
1759 | rxvt_term::button_press (XButtonEvent &ev) |
1795 | rxvt_term::button_press (XButtonEvent &ev) |
1760 | { |
1796 | { |
1761 | int reportmode = 0, clickintime; |
1797 | int reportmode = 0, clickintime; |
1762 | |
1798 | |
1763 | bypass_keystate = ev.state & (ModMetaMask | ShiftMask); |
1799 | bypass_keystate = ev.state & (ModMetaMask | ShiftMask); |
|
|
1800 | |
1764 | if (!bypass_keystate) |
1801 | if (!bypass_keystate) |
1765 | reportmode = !! (priv_modes & PrivMode_mouse_report); |
1802 | reportmode = !! (priv_modes & PrivMode_mouse_report); |
1766 | |
1803 | |
1767 | /* |
1804 | /* |
1768 | * VT window processing of button press |
1805 | * VT window processing of button press |
… | |
… | |
1817 | else |
1854 | else |
1818 | { |
1855 | { |
1819 | if (ev.button != MEvent.button) |
1856 | if (ev.button != MEvent.button) |
1820 | MEvent.clicks = 0; |
1857 | MEvent.clicks = 0; |
1821 | |
1858 | |
|
|
1859 | if (!PERL_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END))) |
1822 | switch (ev.button) |
1860 | switch (ev.button) |
1823 | { |
1861 | { |
1824 | case Button1: |
1862 | case Button1: |
1825 | /* allow meta + click to select rectangular areas */ |
1863 | /* allow meta + click to select rectangular areas */ |
1826 | /* should be done in screen.C */ |
1864 | /* should be done in screen.C */ |
1827 | #if ENABLE_FRILLS |
1865 | #if ENABLE_FRILLS |
1828 | selection.rect = !!(ev.state & ModMetaMask); |
1866 | selection.rect = !!(ev.state & ModMetaMask); |
1829 | #else |
1867 | #else |
1830 | selection.rect = false; |
1868 | selection.rect = false; |
1831 | #endif |
1869 | #endif |
1832 | |
1870 | |
1833 | /* allow shift+left click to extend selection */ |
1871 | /* allow shift+left click to extend selection */ |
1834 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1872 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1835 | { |
1873 | { |
1836 | if (MEvent.button == Button1 && clickintime) |
1874 | if (MEvent.button == Button1 && clickintime) |
1837 | selection_rotate (ev.x, ev.y); |
1875 | selection_rotate (ev.x, ev.y); |
1838 | else |
1876 | else |
1839 | selection_extend (ev.x, ev.y, 1); |
1877 | selection_extend (ev.x, ev.y, 1); |
1840 | } |
1878 | } |
1841 | else |
1879 | else |
1842 | { |
1880 | { |
1843 | if (MEvent.button == Button1 && clickintime) |
1881 | if (MEvent.button == Button1 && clickintime) |
1844 | MEvent.clicks++; |
1882 | MEvent.clicks++; |
1845 | else |
1883 | else |
1846 | MEvent.clicks = 1; |
1884 | MEvent.clicks = 1; |
1847 | |
1885 | |
1848 | selection_click (MEvent.clicks, ev.x, ev.y); |
1886 | selection_click (MEvent.clicks, ev.x, ev.y); |
1849 | } |
1887 | } |
1850 | |
1888 | |
1851 | MEvent.button = Button1; |
1889 | MEvent.button = Button1; |
1852 | break; |
1890 | break; |
1853 | |
1891 | |
1854 | case Button3: |
1892 | case Button3: |
1855 | if (MEvent.button == Button3 && clickintime) |
1893 | if (MEvent.button == Button3 && clickintime) |
1856 | selection_rotate (ev.x, ev.y); |
1894 | selection_rotate (ev.x, ev.y); |
1857 | else |
1895 | else |
1858 | selection_extend (ev.x, ev.y, 1); |
1896 | selection_extend (ev.x, ev.y, 1); |
1859 | |
1897 | |
1860 | MEvent.button = Button3; |
1898 | MEvent.button = Button3; |
1861 | break; |
1899 | break; |
1862 | } |
1900 | } |
1863 | } |
1901 | } |
1864 | |
1902 | |
1865 | MEvent.time = ev.time; |
1903 | MEvent.time = ev.time; |
1866 | return; |
1904 | return; |
1867 | } |
1905 | } |
1868 | |
1906 | |
… | |
… | |
2098 | |
2136 | |
2099 | v = ev.button == Button4 ? UP : DN; |
2137 | v = ev.button == Button4 ? UP : DN; |
2100 | |
2138 | |
2101 | if (ev.state & ShiftMask) |
2139 | if (ev.state & ShiftMask) |
2102 | i = 1; |
2140 | i = 1; |
2103 | else if (options & Opt_mouseWheelScrollPage) |
2141 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2104 | i = nrow - 1; |
2142 | i = nrow - 1; |
2105 | else |
2143 | else |
2106 | i = 5; |
2144 | i = 5; |
2107 | |
2145 | |
2108 | # ifdef MOUSE_SLIP_WHEELING |
2146 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2394 | XWindowAttributes wattr, wrootattr; |
2432 | XWindowAttributes wattr, wrootattr; |
2395 | dDisp; |
2433 | dDisp; |
2396 | |
2434 | |
2397 | pchanged = 0; |
2435 | pchanged = 0; |
2398 | |
2436 | |
2399 | if (!(options & Opt_transparent)) |
2437 | if (!OPTION (Opt_transparent)) |
2400 | return pchanged; /* Don't try any more */ |
2438 | return pchanged; /* Don't try any more */ |
2401 | |
2439 | |
2402 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2440 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2403 | rootdepth = wrootattr.depth; |
2441 | rootdepth = wrootattr.depth; |
2404 | |
2442 | |
… | |
… | |
2682 | if (ch == C0_LF) |
2720 | if (ch == C0_LF) |
2683 | nlines++; |
2721 | nlines++; |
2684 | |
2722 | |
2685 | refresh_count++; |
2723 | refresh_count++; |
2686 | |
2724 | |
2687 | if (!(options & Opt_jumpScroll) |
2725 | if (!OPTION (Opt_jumpScroll) |
2688 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2726 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2689 | { |
2727 | { |
2690 | refreshnow = true; |
2728 | refreshnow = true; |
|
|
2729 | refresh_count = 0; |
2691 | ch = NOCHAR; |
2730 | ch = NOCHAR; |
2692 | break; |
2731 | break; |
2693 | } |
2732 | } |
2694 | |
2733 | |
2695 | // scr_add_lines only works for nlines <= nrow - 1. |
2734 | // scr_add_lines only works for nlines <= nrow - 1. |
… | |
… | |
2726 | * the number of pages between refreshes is refresh_limit, which |
2765 | * the number of pages between refreshes is refresh_limit, which |
2727 | * is incremented here because we must be doing flat-out scrolling. |
2766 | * is incremented here because we must be doing flat-out scrolling. |
2728 | */ |
2767 | */ |
2729 | if (refreshnow) |
2768 | if (refreshnow) |
2730 | { |
2769 | { |
2731 | if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2770 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2732 | refresh_limit++; |
2771 | refresh_limit++; |
2733 | else |
2772 | else |
2734 | { |
2773 | { |
2735 | flag = true; |
2774 | flag = true; |
2736 | scr_refresh (refresh_type); |
2775 | scr_refresh (refresh_type); |
|
|
2776 | flush_ev.stop (); |
2737 | } |
2777 | } |
2738 | } |
2778 | } |
2739 | |
2779 | |
2740 | } |
2780 | } |
2741 | else |
2781 | else |
… | |
… | |
3400 | break; |
3440 | break; |
3401 | case 6: /* CPR requested */ |
3441 | case 6: /* CPR requested */ |
3402 | scr_report_position (); |
3442 | scr_report_position (); |
3403 | break; |
3443 | break; |
3404 | case 7: /* unofficial extension */ |
3444 | case 7: /* unofficial extension */ |
3405 | if (options & Opt_insecure) |
3445 | if (OPTION (Opt_insecure)) |
3406 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3446 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3407 | break; |
3447 | break; |
3408 | case 8: /* unofficial extension */ |
3448 | case 8: /* unofficial extension */ |
3409 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3449 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3410 | break; |
3450 | break; |
… | |
… | |
3574 | break; |
3614 | break; |
3575 | case 20: /* report icon label */ |
3615 | case 20: /* report icon label */ |
3576 | { |
3616 | { |
3577 | char *s; |
3617 | char *s; |
3578 | XGetIconName (disp, parent[0], &s); |
3618 | XGetIconName (disp, parent[0], &s); |
3579 | tt_printf ("\033]L%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3619 | tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3580 | XFree (s); |
3620 | XFree (s); |
3581 | } |
3621 | } |
3582 | break; |
3622 | break; |
3583 | case 21: /* report window title */ |
3623 | case 21: /* report window title */ |
3584 | { |
3624 | { |
3585 | char *s; |
3625 | char *s; |
3586 | XFetchName (disp, parent[0], &s); |
3626 | XFetchName (disp, parent[0], &s); |
3587 | tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3627 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3588 | XFree (s); |
3628 | XFree (s); |
3589 | } |
3629 | } |
3590 | break; |
3630 | break; |
3591 | } |
3631 | } |
3592 | } |
3632 | } |
… | |
… | |
3868 | // TODO, when secure mode? |
3908 | // TODO, when secure mode? |
3869 | break; |
3909 | break; |
3870 | |
3910 | |
3871 | #ifdef MENUBAR |
3911 | #ifdef MENUBAR |
3872 | case URxvt_Menu: |
3912 | case URxvt_Menu: |
3873 | if (options & Opt_insecure) |
3913 | if (OPTION (Opt_insecure)) |
3874 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3914 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3875 | break; |
3915 | break; |
3876 | #endif |
3916 | #endif |
3877 | #if 0 |
3917 | #if 0 |
3878 | case XTerm_dumpscreen: /* no error notices */ |
3918 | case XTerm_dumpscreen: /* no error notices */ |
… | |
… | |
3894 | case URxvt_italicFont: |
3934 | case URxvt_italicFont: |
3895 | case URxvt_boldItalicFont: |
3935 | case URxvt_boldItalicFont: |
3896 | #endif |
3936 | #endif |
3897 | if (query) |
3937 | if (query) |
3898 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3938 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3899 | (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3939 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3900 | ? fontset[op - URxvt_font]->fontdesc : "", |
3940 | ? fontset[op - URxvt_font]->fontdesc : "", |
3901 | resp); |
3941 | resp); |
3902 | else |
3942 | else |
3903 | { |
3943 | { |
3904 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3944 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3910 | break; |
3950 | break; |
3911 | |
3951 | |
3912 | #if ENABLE_FRILLS |
3952 | #if ENABLE_FRILLS |
3913 | case URxvt_locale: |
3953 | case URxvt_locale: |
3914 | if (query) |
3954 | if (query) |
3915 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); |
3955 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp); |
3916 | else |
3956 | else |
3917 | { |
3957 | { |
3918 | set_locale (str); |
3958 | set_locale (str); |
3919 | pty.set_utf8_mode (enc_utf8); |
3959 | pty.set_utf8_mode (enc_utf8); |
3920 | init_xlocale (); |
3960 | init_xlocale (); |
3921 | } |
3961 | } |
3922 | break; |
3962 | break; |
3923 | |
3963 | |
3924 | case URxvt_view_up: |
3964 | case URxvt_view_up: |
3925 | case URxvt_view_down: |
3965 | case URxvt_view_down: |
|
|
3966 | { |
3926 | int lines = atoi (str); |
3967 | int lines = atoi (str); |
3927 | |
3968 | |
3928 | if (lines) |
3969 | if (lines) |
3929 | scr_page (op == URxvt_view_up ? UP : DN, lines); |
3970 | scr_page (op == URxvt_view_up ? UP : DN, lines); |
3930 | else |
3971 | else |
3931 | { |
|
|
3932 | scr_erase_savelines (); |
3972 | scr_erase_savelines (); |
3933 | } |
3973 | } |
3934 | |
3974 | |
|
|
3975 | break; |
|
|
3976 | #endif |
|
|
3977 | |
|
|
3978 | #if ENABLE_PERL |
|
|
3979 | case URxvt_perl: |
|
|
3980 | if (PERL_INVOKE ((this, HOOK_OSC_SEQ, DT_STRING, str, DT_END))) |
|
|
3981 | ; // no responses yet |
3935 | break; |
3982 | break; |
3936 | #endif |
3983 | #endif |
3937 | } |
3984 | } |
3938 | } |
3985 | } |
3939 | /*----------------------------------------------------------------------*/ |
3986 | /*----------------------------------------------------------------------*/ |
… | |
… | |
4048 | } |
4095 | } |
4049 | |
4096 | |
4050 | /* extra handling for values with state unkept */ |
4097 | /* extra handling for values with state unkept */ |
4051 | switch (arg[i]) |
4098 | switch (arg[i]) |
4052 | { |
4099 | { |
|
|
4100 | #if ENABLE_STYLES |
|
|
4101 | case 1021: |
|
|
4102 | if (mode) |
|
|
4103 | SET_OPTION (Opt_intensityStyles); |
|
|
4104 | else |
|
|
4105 | CLR_OPTION (Opt_intensityStyles); |
|
|
4106 | |
|
|
4107 | scr_touch (true); |
|
|
4108 | break; |
|
|
4109 | #endif |
4053 | case 1048: /* alternative cursor save */ |
4110 | case 1048: /* alternative cursor save */ |
4054 | case 1049: |
4111 | case 1049: |
4055 | if (options & Opt_secondaryScreen) |
4112 | if (OPTION (Opt_secondaryScreen)) |
4056 | if (mode == 0) |
4113 | if (mode == 0) |
4057 | scr_cursor (RESTORE); |
4114 | scr_cursor (RESTORE); |
4058 | else if (mode == 1) |
4115 | else if (mode == 1) |
4059 | scr_cursor (SAVE); |
4116 | scr_cursor (SAVE); |
4060 | break; |
4117 | break; |
… | |
… | |
4075 | case 3: /* 80/132 */ |
4132 | case 3: /* 80/132 */ |
4076 | if (priv_modes & PrivMode_132OK) |
4133 | if (priv_modes & PrivMode_132OK) |
4077 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4134 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4078 | break; |
4135 | break; |
4079 | case 4: /* smooth scrolling */ |
4136 | case 4: /* smooth scrolling */ |
4080 | if (state) |
4137 | if (!state) |
4081 | options &= ~Opt_jumpScroll; |
4138 | SET_OPTION (Opt_jumpScroll); |
4082 | else |
4139 | else |
4083 | options |= Opt_jumpScroll; |
4140 | CLR_OPTION (Opt_jumpScroll); |
4084 | break; |
4141 | break; |
4085 | case 5: /* reverse video */ |
4142 | case 5: /* reverse video */ |
4086 | scr_rvideo_mode (state); |
4143 | scr_rvideo_mode (state); |
4087 | break; |
4144 | break; |
4088 | case 6: /* relative/absolute origins */ |
4145 | case 6: /* relative/absolute origins */ |
… | |
… | |
4129 | #if 0 |
4186 | #if 0 |
4130 | case 1001: |
4187 | case 1001: |
4131 | break; /* X11 mouse highlighting */ |
4188 | break; /* X11 mouse highlighting */ |
4132 | #endif |
4189 | #endif |
4133 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4190 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4134 | if (state) |
4191 | if (!state) |
4135 | options &= ~Opt_scrollTtyOutput; |
4192 | SET_OPTION (Opt_scrollTtyOutput); |
4136 | else |
4193 | else |
4137 | options |= Opt_scrollTtyOutput; |
4194 | CLR_OPTION (Opt_scrollTtyOutput); |
4138 | break; |
4195 | break; |
4139 | case 1011: /* scroll to bottom on key press */ |
4196 | case 1011: /* scroll to bottom on key press */ |
4140 | if (state) |
4197 | if (state) |
4141 | options |= Opt_scrollTtyKeypress; |
4198 | SET_OPTION (Opt_scrollTtyKeypress); |
4142 | else |
4199 | else |
4143 | options &= ~Opt_scrollTtyKeypress; |
4200 | CLR_OPTION (Opt_scrollTtyKeypress); |
4144 | break; |
4201 | break; |
4145 | case 1047: /* secondary screen w/ clearing last */ |
4202 | case 1047: /* secondary screen w/ clearing last */ |
4146 | if (options & Opt_secondaryScreen) |
4203 | if (OPTION (Opt_secondaryScreen)) |
4147 | if (current_screen != PRIMARY) |
4204 | if (current_screen != PRIMARY) |
4148 | scr_erase_screen (2); |
4205 | scr_erase_screen (2); |
4149 | scr_change_screen (state); |
4206 | scr_change_screen (state); |
4150 | break; |
4207 | break; |
4151 | case 1049: /* secondary screen w/ clearing first */ |
4208 | case 1049: /* secondary screen w/ clearing first */ |
4152 | scr_change_screen (state); |
4209 | scr_change_screen (state); |
4153 | if (options & Opt_secondaryScreen) |
4210 | if (OPTION (Opt_secondaryScreen)) |
4154 | if (current_screen != PRIMARY) |
4211 | if (current_screen != PRIMARY) |
4155 | scr_erase_screen (2); |
4212 | scr_erase_screen (2); |
4156 | break; |
4213 | break; |
4157 | default: |
4214 | default: |
4158 | break; |
4215 | break; |
… | |
… | |
4308 | case 106: |
4365 | case 106: |
4309 | case 107: |
4366 | case 107: |
4310 | scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg); |
4367 | scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg); |
4311 | break; |
4368 | break; |
4312 | #endif |
4369 | #endif |
4313 | |
|
|
4314 | } |
4370 | } |
4315 | } |
4371 | } |
4316 | } |
4372 | } |
4317 | /*}}} */ |
4373 | /*}}} */ |
4318 | |
4374 | |