… | |
… | |
500 | # if ISO_14755 |
500 | # if ISO_14755 |
501 | iso14755_51 (0); |
501 | iso14755_51 (0); |
502 | # endif |
502 | # endif |
503 | return; |
503 | return; |
504 | } |
504 | } |
|
|
505 | else if (keysym == XK_BackSpace) |
|
|
506 | { |
|
|
507 | iso14755buf = ((iso14755buf & ISO_14755_MASK) >> 4) | ISO_14755_51; |
|
|
508 | # if ISO_14755 |
|
|
509 | iso14755_51 (iso14755buf & ISO_14755_MASK); |
|
|
510 | # endif |
|
|
511 | return; |
|
|
512 | } |
505 | else if ((hv = hex_keyval (ev)) >= 0) |
513 | else if ((hv = hex_keyval (ev)) >= 0) |
506 | { |
514 | { |
507 | iso14755buf = ((iso14755buf << 4) & ISO_14755_MASK) |
515 | iso14755buf = ((iso14755buf << 4) & ISO_14755_MASK) |
508 | | hv | ISO_14755_51; |
516 | | hv | ISO_14755_51; |
509 | # if ISO_14755 |
517 | # if ISO_14755 |
… | |
… | |
528 | scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); |
536 | scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); |
529 | scr_overlay_set (0, 0, "ISO 14755 mode"); |
537 | scr_overlay_set (0, 0, "ISO 14755 mode"); |
530 | # endif |
538 | # endif |
531 | } |
539 | } |
532 | #endif |
540 | #endif |
533 | |
541 | |
534 | #ifdef PRINTPIPE |
542 | #ifdef PRINTPIPE |
535 | if (keysym == XK_Print) |
543 | if (keysym == XK_Print) |
536 | { |
544 | { |
537 | scr_printscreen (ctrl | shft); |
545 | scr_printscreen (ctrl | shft); |
538 | return; |
546 | return; |
… | |
… | |
877 | return; |
885 | return; |
878 | |
886 | |
879 | if (len <= 0) |
887 | if (len <= 0) |
880 | return; /* not mapped */ |
888 | return; /* not mapped */ |
881 | |
889 | |
882 | if (OPTION (Opt_scrollTtyKeypress)) |
890 | if (option (Opt_scrollTtyKeypress)) |
883 | if (view_start) |
891 | if (view_start) |
884 | { |
892 | { |
885 | view_start = 0; |
893 | view_start = 0; |
886 | want_refresh = 1; |
894 | want_refresh = 1; |
887 | } |
895 | } |
… | |
… | |
965 | scr_overlay_off (); |
973 | scr_overlay_off (); |
966 | # endif |
974 | # endif |
967 | if (iso14755buf & ISO_14755_51) |
975 | if (iso14755buf & ISO_14755_51) |
968 | commit_iso14755 (); |
976 | commit_iso14755 (); |
969 | #if ISO_14755 |
977 | #if ISO_14755 |
970 | else if (iso14755buf & ISO_14755_STARTED) |
978 | else if (option (Opt_iso14755_52) && iso14755buf & ISO_14755_STARTED) |
971 | { |
979 | { |
972 | iso14755buf = ISO_14755_52; // iso14755 part 5.2: remember empty begin/end pair |
980 | iso14755buf = ISO_14755_52; // iso14755 part 5.2: remember empty begin/end pair |
973 | |
981 | |
974 | scr_overlay_new (0, -1, sizeof ("KEYCAP PICTURE INSERT MODE") - 1, 1); |
982 | scr_overlay_new (0, -1, sizeof ("KEYCAP PICTURE INSERT MODE") - 1, 1); |
975 | scr_overlay_set (0, 0, "KEYCAP PICTURE INSERT MODE"); |
983 | scr_overlay_set (0, 0, "KEYCAP PICTURE INSERT MODE"); |
… | |
… | |
1178 | |
1186 | |
1179 | #if LINUX_YIELD_HACK |
1187 | #if LINUX_YIELD_HACK |
1180 | static struct event_handler |
1188 | static struct event_handler |
1181 | { |
1189 | { |
1182 | check_watcher yield_ev; |
1190 | check_watcher yield_ev; |
1183 | |
1191 | |
1184 | void yield_cb (check_watcher &w) |
1192 | void yield_cb (check_watcher &w) |
1185 | { |
1193 | { |
1186 | // this should really be sched_yield(), but the linux guys thought |
1194 | // this should really be sched_yield(), but the linux guys thought |
1187 | // that giving a process calling sched_yield () less cpu time than |
1195 | // that giving a process calling sched_yield () less cpu time than |
1188 | // ones with high nice levels is a useful thing to do. It surely is is |
1196 | // ones with high nice levels is a useful thing to do. It surely is is |
… | |
… | |
1232 | } |
1240 | } |
1233 | else |
1241 | else |
1234 | { |
1242 | { |
1235 | pty_ev.stop (); |
1243 | pty_ev.stop (); |
1236 | |
1244 | |
1237 | if (!OPTION (Opt_hold)) |
1245 | if (!option (Opt_hold)) |
1238 | destroy (); |
1246 | destroy (); |
1239 | } |
1247 | } |
1240 | |
1248 | |
1241 | return false; |
1249 | return false; |
1242 | } |
1250 | } |
1243 | |
1251 | |
1244 | void |
1252 | void |
1245 | rxvt_term::pty_cb (io_watcher &w, short revents) |
1253 | rxvt_term::pty_cb (io_watcher &w, short revents) |
… | |
… | |
1263 | recolour_cursor (); |
1271 | recolour_cursor (); |
1264 | |
1272 | |
1265 | #ifdef POINTER_BLANK |
1273 | #ifdef POINTER_BLANK |
1266 | hidden_pointer = 0; |
1274 | hidden_pointer = 0; |
1267 | |
1275 | |
1268 | if (OPTION (Opt_pointerBlank)) |
1276 | if (option (Opt_pointerBlank)) |
1269 | pointer_ev.start (NOW + pointerBlankDelay); |
1277 | pointer_ev.start (NOW + pointerBlankDelay); |
1270 | #endif |
1278 | #endif |
1271 | } |
1279 | } |
1272 | |
1280 | |
1273 | #ifdef POINTER_BLANK |
1281 | #ifdef POINTER_BLANK |
1274 | void |
1282 | void |
1275 | rxvt_term::pointer_blank () |
1283 | rxvt_term::pointer_blank () |
1276 | { |
1284 | { |
1277 | if (!OPTION (Opt_pointerBlank)) |
1285 | if (!option (Opt_pointerBlank)) |
1278 | return; |
1286 | return; |
1279 | |
1287 | |
1280 | XDefineCursor (dpy, vt, display->blank_cursor); |
1288 | XDefineCursor (dpy, vt, display->blank_cursor); |
1281 | XFlush (dpy); |
1289 | XFlush (dpy); |
1282 | |
1290 | |
… | |
… | |
1458 | break; |
1466 | break; |
1459 | } |
1467 | } |
1460 | break; |
1468 | break; |
1461 | |
1469 | |
1462 | case FocusIn: |
1470 | case FocusIn: |
1463 | if (ev.xfocus.detail != NotifyInferior && ev.xfocus.detail != NotifyPointer) |
1471 | if (ev.xfocus.detail != NotifyInferior |
|
|
1472 | && ev.xfocus.detail != NotifyPointer |
|
|
1473 | && ev.xfocus.mode != NotifyGrab) |
1464 | focus_in (); |
1474 | focus_in (); |
1465 | break; |
1475 | break; |
1466 | |
1476 | |
1467 | case FocusOut: |
1477 | case FocusOut: |
1468 | if (ev.xfocus.detail != NotifyInferior && ev.xfocus.detail != NotifyPointer) |
1478 | if (ev.xfocus.detail != NotifyInferior |
|
|
1479 | && ev.xfocus.detail != NotifyPointer |
|
|
1480 | && ev.xfocus.mode != NotifyGrab) |
1469 | focus_out (); |
1481 | focus_out (); |
1470 | break; |
1482 | break; |
1471 | |
1483 | |
1472 | case ConfigureNotify: |
1484 | case ConfigureNotify: |
1473 | if (ev.xconfigure.window == parent[0]) |
1485 | if (ev.xconfigure.window == parent[0]) |
… | |
… | |
1477 | |
1489 | |
1478 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1490 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1479 | { |
1491 | { |
1480 | seen_resize = 1; |
1492 | seen_resize = 1; |
1481 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1493 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
|
|
1494 | #ifdef XPM_BACKGROUND |
|
|
1495 | if (!option (Opt_transparent) && bgPixmap.auto_resize) |
|
|
1496 | { |
|
|
1497 | resize_pixmap (); |
|
|
1498 | scr_touch (true); |
|
|
1499 | } |
|
|
1500 | #endif |
1482 | } |
1501 | } |
1483 | |
1502 | |
1484 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1503 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1485 | |
1504 | |
1486 | #ifdef TRANSPARENT |
1505 | #ifdef TRANSPARENT |
1487 | if (OPTION (Opt_transparent)) |
1506 | if (option (Opt_transparent)) |
1488 | check_our_parents (); |
1507 | check_our_parents (); |
1489 | #endif |
1508 | #endif |
1490 | } |
1509 | } |
1491 | break; |
1510 | break; |
1492 | |
1511 | |
… | |
… | |
1681 | } |
1700 | } |
1682 | break; |
1701 | break; |
1683 | } |
1702 | } |
1684 | |
1703 | |
1685 | #if defined(CURSOR_BLINK) |
1704 | #if defined(CURSOR_BLINK) |
1686 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1705 | if (option (Opt_cursorBlink) && ev.type == KeyPress) |
1687 | { |
1706 | { |
1688 | if (hidden_cursor) |
1707 | if (hidden_cursor) |
1689 | { |
1708 | { |
1690 | hidden_cursor = 0; |
1709 | hidden_cursor = 0; |
1691 | want_refresh = 1; |
1710 | want_refresh = 1; |
… | |
… | |
1694 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1713 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1695 | } |
1714 | } |
1696 | #endif |
1715 | #endif |
1697 | |
1716 | |
1698 | #if defined(POINTER_BLANK) |
1717 | #if defined(POINTER_BLANK) |
1699 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1718 | if (option (Opt_pointerBlank) && pointerBlankDelay > 0) |
1700 | { |
1719 | { |
1701 | if (ev.type == MotionNotify |
1720 | if (ev.type == MotionNotify |
1702 | || ev.type == ButtonPress |
1721 | || ev.type == ButtonPress |
1703 | || ev.type == ButtonRelease) |
1722 | || ev.type == ButtonRelease) |
1704 | if (hidden_pointer) |
1723 | if (hidden_pointer) |
… | |
… | |
1726 | IMSetPosition (); |
1745 | IMSetPosition (); |
1727 | XSetICFocus (Input_Context); |
1746 | XSetICFocus (Input_Context); |
1728 | } |
1747 | } |
1729 | #endif |
1748 | #endif |
1730 | #if CURSOR_BLINK |
1749 | #if CURSOR_BLINK |
1731 | if (OPTION (Opt_cursorBlink)) |
1750 | if (option (Opt_cursorBlink)) |
1732 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1751 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1733 | #endif |
1752 | #endif |
1734 | #if OFF_FOCUS_FADING |
1753 | #if OFF_FOCUS_FADING |
1735 | if (rs[Rs_fade]) |
1754 | if (rs[Rs_fade]) |
1736 | { |
1755 | { |
1737 | pix_colors = pix_colors_focused; |
1756 | pix_colors = pix_colors_focused; |
1738 | scr_recolour (); |
1757 | scr_recolour (); |
|
|
1758 | } |
|
|
1759 | #endif |
|
|
1760 | #if ENABLE_FRILLS |
|
|
1761 | if (option (Opt_urgentOnBell)) |
|
|
1762 | { |
|
|
1763 | XWMHints *h; |
|
|
1764 | |
|
|
1765 | h = XGetWMHints(dpy, parent[0]); |
|
|
1766 | if (h != NULL) |
|
|
1767 | { |
|
|
1768 | h->flags &= ~XUrgencyHint; |
|
|
1769 | XSetWMHints(dpy, parent[0], h); |
|
|
1770 | } |
1739 | } |
1771 | } |
1740 | #endif |
1772 | #endif |
1741 | } |
1773 | } |
1742 | } |
1774 | } |
1743 | |
1775 | |
… | |
… | |
1763 | #if USE_XIM |
1795 | #if USE_XIM |
1764 | if (Input_Context != NULL) |
1796 | if (Input_Context != NULL) |
1765 | XUnsetICFocus (Input_Context); |
1797 | XUnsetICFocus (Input_Context); |
1766 | #endif |
1798 | #endif |
1767 | #if CURSOR_BLINK |
1799 | #if CURSOR_BLINK |
1768 | if (OPTION (Opt_cursorBlink)) |
1800 | if (option (Opt_cursorBlink)) |
1769 | cursor_blink_ev.stop (); |
1801 | cursor_blink_ev.stop (); |
1770 | hidden_cursor = 0; |
1802 | hidden_cursor = 0; |
1771 | #endif |
1803 | #endif |
1772 | #if OFF_FOCUS_FADING |
1804 | #if OFF_FOCUS_FADING |
1773 | if (rs[Rs_fade]) |
1805 | if (rs[Rs_fade]) |
… | |
… | |
1814 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1846 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1815 | return; |
1847 | return; |
1816 | |
1848 | |
1817 | /* FALLTHROUGH */ |
1849 | /* FALLTHROUGH */ |
1818 | case ReparentNotify: |
1850 | case ReparentNotify: |
1819 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1851 | if (option (Opt_transparent)) |
1820 | want_refresh = want_full_refresh = 1; |
1852 | check_our_parents (); |
1821 | break; |
1853 | break; |
1822 | } |
1854 | } |
1823 | # endif |
1855 | # endif |
1824 | } |
1856 | } |
1825 | #endif |
1857 | #endif |
… | |
… | |
2170 | |
2202 | |
2171 | v = ev.button == Button4 ? UP : DN; |
2203 | v = ev.button == Button4 ? UP : DN; |
2172 | |
2204 | |
2173 | if (ev.state & ShiftMask) |
2205 | if (ev.state & ShiftMask) |
2174 | i = 1; |
2206 | i = 1; |
2175 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2207 | else if (option (Opt_mouseWheelScrollPage)) |
2176 | i = nrow - 1; |
2208 | i = nrow - 1; |
2177 | else |
2209 | else |
2178 | i = 5; |
2210 | i = 5; |
2179 | |
2211 | |
2180 | # ifdef MOUSE_SLIP_WHEELING |
2212 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2201 | break; |
2233 | break; |
2202 | #endif |
2234 | #endif |
2203 | } |
2235 | } |
2204 | } |
2236 | } |
2205 | } |
2237 | } |
2206 | |
|
|
2207 | #ifdef TRANSPARENT |
|
|
2208 | #if TINTING |
|
|
2209 | /* taken from aterm-0.4.2 */ |
|
|
2210 | |
|
|
2211 | typedef uint32_t RUINT32T; |
|
|
2212 | |
|
|
2213 | void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm) |
|
|
2214 | { |
|
|
2215 | int sh_r, sh_g, sh_b; |
|
|
2216 | RUINT32T mask_r, mask_g, mask_b; |
|
|
2217 | RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b; |
|
|
2218 | unsigned int lower_lim_r, lower_lim_g, lower_lim_b; |
|
|
2219 | unsigned int upper_lim_r, upper_lim_g, upper_lim_b; |
|
|
2220 | int i; |
|
|
2221 | |
|
|
2222 | Visual *visual = term->visual; |
|
|
2223 | |
|
|
2224 | if( visual->c_class != TrueColor || srcImage->format != ZPixmap ) return ; |
|
|
2225 | |
|
|
2226 | /* for convenience */ |
|
|
2227 | mask_r = visual->red_mask; |
|
|
2228 | mask_g = visual->green_mask; |
|
|
2229 | mask_b = visual->blue_mask; |
|
|
2230 | |
|
|
2231 | /* boring lookup table pre-initialization */ |
|
|
2232 | switch (srcImage->bits_per_pixel) { |
|
|
2233 | case 15: |
|
|
2234 | if ((mask_r != 0x7c00) || |
|
|
2235 | (mask_g != 0x03e0) || |
|
|
2236 | (mask_b != 0x001f)) |
|
|
2237 | return; |
|
|
2238 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+32+32)); |
|
|
2239 | lookup_r = lookup; |
|
|
2240 | lookup_g = lookup+32; |
|
|
2241 | lookup_b = lookup+32+32; |
|
|
2242 | sh_r = 10; |
|
|
2243 | sh_g = 5; |
|
|
2244 | sh_b = 0; |
|
|
2245 | break; |
|
|
2246 | case 16: |
|
|
2247 | if ((mask_r != 0xf800) || |
|
|
2248 | (mask_g != 0x07e0) || |
|
|
2249 | (mask_b != 0x001f)) |
|
|
2250 | return; |
|
|
2251 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+64+32)); |
|
|
2252 | lookup_r = lookup; |
|
|
2253 | lookup_g = lookup+32; |
|
|
2254 | lookup_b = lookup+32+64; |
|
|
2255 | sh_r = 11; |
|
|
2256 | sh_g = 5; |
|
|
2257 | sh_b = 0; |
|
|
2258 | break; |
|
|
2259 | case 24: |
|
|
2260 | if ((mask_r != 0xff0000) || |
|
|
2261 | (mask_g != 0x00ff00) || |
|
|
2262 | (mask_b != 0x0000ff)) |
|
|
2263 | return; |
|
|
2264 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256)); |
|
|
2265 | lookup_r = lookup; |
|
|
2266 | lookup_g = lookup+256; |
|
|
2267 | lookup_b = lookup+256+256; |
|
|
2268 | sh_r = 16; |
|
|
2269 | sh_g = 8; |
|
|
2270 | sh_b = 0; |
|
|
2271 | break; |
|
|
2272 | case 32: |
|
|
2273 | if ((mask_r != 0xff0000) || |
|
|
2274 | (mask_g != 0x00ff00) || |
|
|
2275 | (mask_b != 0x0000ff)) |
|
|
2276 | return; |
|
|
2277 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256)); |
|
|
2278 | lookup_r = lookup; |
|
|
2279 | lookup_g = lookup+256; |
|
|
2280 | lookup_b = lookup+256+256; |
|
|
2281 | sh_r = 16; |
|
|
2282 | sh_g = 8; |
|
|
2283 | sh_b = 0; |
|
|
2284 | break; |
|
|
2285 | default: |
|
|
2286 | return; /* we do not support this color depth */ |
|
|
2287 | } |
|
|
2288 | |
|
|
2289 | /* prepare limits for color transformation (each channel is handled separately) */ |
|
|
2290 | if (shade < 0) { |
|
|
2291 | shade = -shade; |
|
|
2292 | if (shade < 0) shade = 0; |
|
|
2293 | if (shade > 100) shade = 100; |
|
|
2294 | |
|
|
2295 | lower_lim_r = 65535-rm; |
|
|
2296 | lower_lim_g = 65535-gm; |
|
|
2297 | lower_lim_b = 65535-bm; |
|
|
2298 | |
|
|
2299 | lower_lim_r = 65535-(unsigned int)(((RUINT32T)lower_lim_r)*((RUINT32T)shade)/100); |
|
|
2300 | lower_lim_g = 65535-(unsigned int)(((RUINT32T)lower_lim_g)*((RUINT32T)shade)/100); |
|
|
2301 | lower_lim_b = 65535-(unsigned int)(((RUINT32T)lower_lim_b)*((RUINT32T)shade)/100); |
|
|
2302 | |
|
|
2303 | upper_lim_r = upper_lim_g = upper_lim_b = 65535; |
|
|
2304 | } else { |
|
|
2305 | if (shade < 0) shade = 0; |
|
|
2306 | if (shade > 100) shade = 100; |
|
|
2307 | |
|
|
2308 | lower_lim_r = lower_lim_g = lower_lim_b = 0; |
|
|
2309 | |
|
|
2310 | upper_lim_r = (unsigned int)((((RUINT32T)rm)*((RUINT32T)shade))/100); |
|
|
2311 | upper_lim_g = (unsigned int)((((RUINT32T)gm)*((RUINT32T)shade))/100); |
|
|
2312 | upper_lim_b = (unsigned int)((((RUINT32T)bm)*((RUINT32T)shade))/100); |
|
|
2313 | } |
|
|
2314 | |
|
|
2315 | /* switch red and blue bytes if necessary, we need it for some weird XServers like XFree86 3.3.3.1 */ |
|
|
2316 | if ((srcImage->bits_per_pixel == 24) && (mask_r >= 0xFF0000 )) |
|
|
2317 | { |
|
|
2318 | unsigned int tmp; |
|
|
2319 | |
|
|
2320 | tmp = lower_lim_r; |
|
|
2321 | lower_lim_r = lower_lim_b; |
|
|
2322 | lower_lim_b = tmp; |
|
|
2323 | |
|
|
2324 | tmp = upper_lim_r; |
|
|
2325 | upper_lim_r = upper_lim_b; |
|
|
2326 | upper_lim_b = tmp; |
|
|
2327 | } |
|
|
2328 | |
|
|
2329 | /* fill our lookup tables */ |
|
|
2330 | for (i = 0; i <= mask_r>>sh_r; i++) |
|
|
2331 | { |
|
|
2332 | RUINT32T tmp; |
|
|
2333 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_r-lower_lim_r)); |
|
|
2334 | tmp += ((RUINT32T)(mask_r>>sh_r))*((RUINT32T)lower_lim_r); |
|
|
2335 | lookup_r[i] = (tmp/65535)<<sh_r; |
|
|
2336 | } |
|
|
2337 | for (i = 0; i <= mask_g>>sh_g; i++) |
|
|
2338 | { |
|
|
2339 | RUINT32T tmp; |
|
|
2340 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_g-lower_lim_g)); |
|
|
2341 | tmp += ((RUINT32T)(mask_g>>sh_g))*((RUINT32T)lower_lim_g); |
|
|
2342 | lookup_g[i] = (tmp/65535)<<sh_g; |
|
|
2343 | } |
|
|
2344 | for (i = 0; i <= mask_b>>sh_b; i++) |
|
|
2345 | { |
|
|
2346 | RUINT32T tmp; |
|
|
2347 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_b-lower_lim_b)); |
|
|
2348 | tmp += ((RUINT32T)(mask_b>>sh_b))*((RUINT32T)lower_lim_b); |
|
|
2349 | lookup_b[i] = (tmp/65535)<<sh_b; |
|
|
2350 | } |
|
|
2351 | |
|
|
2352 | /* apply table to input image (replacing colors by newly calculated ones) */ |
|
|
2353 | switch (srcImage->bits_per_pixel) |
|
|
2354 | { |
|
|
2355 | case 15: |
|
|
2356 | { |
|
|
2357 | unsigned short *p1, *pf, *p, *pl; |
|
|
2358 | p1 = (unsigned short *) srcImage->data; |
|
|
2359 | pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2360 | while (p1 < pf) |
|
|
2361 | { |
|
|
2362 | p = p1; |
|
|
2363 | pl = p1 + srcImage->width; |
|
|
2364 | for (; p < pl; p++) |
|
|
2365 | { |
|
|
2366 | *p = lookup_r[(*p & 0x7c00)>>10] | |
|
|
2367 | lookup_g[(*p & 0x03e0)>> 5] | |
|
|
2368 | lookup_b[(*p & 0x001f)]; |
|
|
2369 | } |
|
|
2370 | p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2371 | } |
|
|
2372 | break; |
|
|
2373 | } |
|
|
2374 | case 16: |
|
|
2375 | { |
|
|
2376 | unsigned short *p1, *pf, *p, *pl; |
|
|
2377 | p1 = (unsigned short *) srcImage->data; |
|
|
2378 | pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2379 | while (p1 < pf) |
|
|
2380 | { |
|
|
2381 | p = p1; |
|
|
2382 | pl = p1 + srcImage->width; |
|
|
2383 | for (; p < pl; p++) |
|
|
2384 | { |
|
|
2385 | *p = lookup_r[(*p & 0xf800)>>11] | |
|
|
2386 | lookup_g[(*p & 0x07e0)>> 5] | |
|
|
2387 | lookup_b[(*p & 0x001f)]; |
|
|
2388 | } |
|
|
2389 | p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2390 | } |
|
|
2391 | break; |
|
|
2392 | } |
|
|
2393 | case 24: |
|
|
2394 | { |
|
|
2395 | unsigned char *p1, *pf, *p, *pl; |
|
|
2396 | p1 = (unsigned char *) srcImage->data; |
|
|
2397 | pf = (unsigned char *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2398 | while (p1 < pf) |
|
|
2399 | { |
|
|
2400 | p = p1; |
|
|
2401 | pl = p1 + srcImage->width * 3; |
|
|
2402 | for (; p < pl; p += 3) |
|
|
2403 | { |
|
|
2404 | p[0] = lookup_r[(p[0] & 0xff0000)>>16]; |
|
|
2405 | p[1] = lookup_r[(p[1] & 0x00ff00)>> 8]; |
|
|
2406 | p[2] = lookup_r[(p[2] & 0x0000ff)]; |
|
|
2407 | } |
|
|
2408 | p1 = (unsigned char *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2409 | } |
|
|
2410 | break; |
|
|
2411 | } |
|
|
2412 | case 32: |
|
|
2413 | { |
|
|
2414 | RUINT32T *p1, *pf, *p, *pl; |
|
|
2415 | p1 = (RUINT32T *) srcImage->data; |
|
|
2416 | pf = (RUINT32T *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2417 | |
|
|
2418 | while (p1 < pf) |
|
|
2419 | { |
|
|
2420 | p = p1; |
|
|
2421 | pl = p1 + srcImage->width; |
|
|
2422 | for (; p < pl; p++) |
|
|
2423 | { |
|
|
2424 | *p = lookup_r[(*p & 0xff0000)>>16] | |
|
|
2425 | lookup_g[(*p & 0x00ff00)>> 8] | |
|
|
2426 | lookup_b[(*p & 0x0000ff)] | |
|
|
2427 | (*p & ~0xffffff); |
|
|
2428 | } |
|
|
2429 | p1 = (RUINT32T *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2430 | } |
|
|
2431 | break; |
|
|
2432 | } |
|
|
2433 | } |
|
|
2434 | |
|
|
2435 | free (lookup); |
|
|
2436 | } |
|
|
2437 | #endif |
|
|
2438 | |
|
|
2439 | /* |
|
|
2440 | * Check our parents are still who we think they are. |
|
|
2441 | * Do transparency updates if required |
|
|
2442 | */ |
|
|
2443 | int |
|
|
2444 | rxvt_term::check_our_parents () |
|
|
2445 | { |
|
|
2446 | int i, pchanged, aformat, have_pixmap, rootdepth; |
|
|
2447 | unsigned long nitems, bytes_after; |
|
|
2448 | Atom atype; |
|
|
2449 | unsigned char *prop = NULL; |
|
|
2450 | Window root, oldp, *list; |
|
|
2451 | Pixmap rootpixmap = None; |
|
|
2452 | XWindowAttributes wattr, wrootattr; |
|
|
2453 | |
|
|
2454 | pchanged = 0; |
|
|
2455 | |
|
|
2456 | if (!OPTION (Opt_transparent)) |
|
|
2457 | return pchanged; /* Don't try any more */ |
|
|
2458 | |
|
|
2459 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
|
|
2460 | rootdepth = wrootattr.depth; |
|
|
2461 | |
|
|
2462 | XGetWindowAttributes (dpy, parent[0], &wattr); |
|
|
2463 | |
|
|
2464 | if (rootdepth != wattr.depth) |
|
|
2465 | { |
|
|
2466 | if (am_transparent) |
|
|
2467 | { |
|
|
2468 | pchanged = 1; |
|
|
2469 | XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]); |
|
|
2470 | am_transparent = am_pixmap_trans = 0; |
|
|
2471 | } |
|
|
2472 | |
|
|
2473 | return pchanged; /* Don't try any more */ |
|
|
2474 | } |
|
|
2475 | |
|
|
2476 | /* Get all X ops out of the queue so that our information is up-to-date. */ |
|
|
2477 | XSync (dpy, False); |
|
|
2478 | |
|
|
2479 | /* |
|
|
2480 | * Make the frame window set by the window manager have |
|
|
2481 | * the root background. Some window managers put multiple nested frame |
|
|
2482 | * windows for each client, so we have to take care about that. |
|
|
2483 | */ |
|
|
2484 | i = (xa[XA_XROOTPMAP_ID] |
|
|
2485 | && XGetWindowProperty (dpy, display->root, xa[XA_XROOTPMAP_ID], |
|
|
2486 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
2487 | &nitems, &bytes_after, &prop) == Success); |
|
|
2488 | |
|
|
2489 | if (!i || prop == NULL) |
|
|
2490 | i = (xa[XA_ESETROOT_PMAP_ID] |
|
|
2491 | && XGetWindowProperty (dpy, display->root, xa[XA_ESETROOT_PMAP_ID], |
|
|
2492 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
2493 | &nitems, &bytes_after, &prop) == Success); |
|
|
2494 | |
|
|
2495 | if (!i || prop == NULL |
|
|
2496 | #if TINTING |
|
|
2497 | || !ISSET_PIXCOLOR (Color_tint) |
|
|
2498 | #endif |
|
|
2499 | ) |
|
|
2500 | have_pixmap = 0; |
|
|
2501 | else |
|
|
2502 | { |
|
|
2503 | have_pixmap = 1; |
|
|
2504 | rootpixmap = *(Pixmap *)prop; |
|
|
2505 | XFree (prop); |
|
|
2506 | } |
|
|
2507 | |
|
|
2508 | if (have_pixmap) |
|
|
2509 | { |
|
|
2510 | /* |
|
|
2511 | * Copy display->root pixmap transparency |
|
|
2512 | */ |
|
|
2513 | int sx, sy, nx, ny; |
|
|
2514 | unsigned int nw, nh; |
|
|
2515 | Window cr; |
|
|
2516 | XImage *image; |
|
|
2517 | GC gc; |
|
|
2518 | XGCValues gcvalue; |
|
|
2519 | |
|
|
2520 | XTranslateCoordinates (dpy, parent[0], display->root, |
|
|
2521 | 0, 0, &sx, &sy, &cr); |
|
|
2522 | nw = (unsigned int)szHint.width; |
|
|
2523 | nh = (unsigned int)szHint.height; |
|
|
2524 | nx = ny = 0; |
|
|
2525 | |
|
|
2526 | if (sx < 0) |
|
|
2527 | { |
|
|
2528 | nw += sx; |
|
|
2529 | nx = -sx; |
|
|
2530 | sx = 0; |
|
|
2531 | } |
|
|
2532 | |
|
|
2533 | if (sy < 0) |
|
|
2534 | { |
|
|
2535 | nh += sy; |
|
|
2536 | ny = -sy; |
|
|
2537 | sy = 0; |
|
|
2538 | } |
|
|
2539 | |
|
|
2540 | min_it (nw, (unsigned int) (wrootattr.width - sx)); |
|
|
2541 | min_it (nh, (unsigned int) (wrootattr.height - sy)); |
|
|
2542 | |
|
|
2543 | XSync (dpy, False); |
|
|
2544 | allowedxerror = -1; |
|
|
2545 | image = XGetImage (dpy, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
|
|
2546 | |
|
|
2547 | /* XXX: handle BadMatch - usually because we're outside the pixmap */ |
|
|
2548 | /* XXX: may need a delay here? */ |
|
|
2549 | allowedxerror = 0; |
|
|
2550 | |
|
|
2551 | if (image == NULL) |
|
|
2552 | { |
|
|
2553 | if (am_transparent && am_pixmap_trans) |
|
|
2554 | { |
|
|
2555 | pchanged = 1; |
|
|
2556 | if (pixmap != None) |
|
|
2557 | { |
|
|
2558 | XFreePixmap (dpy, pixmap); |
|
|
2559 | pixmap = None; |
|
|
2560 | } |
|
|
2561 | } |
|
|
2562 | |
|
|
2563 | am_pixmap_trans = 0; |
|
|
2564 | } |
|
|
2565 | else |
|
|
2566 | { |
|
|
2567 | if (pixmap != None) |
|
|
2568 | XFreePixmap (dpy, pixmap); |
|
|
2569 | |
|
|
2570 | #if TINTING |
|
|
2571 | if (ISSET_PIXCOLOR (Color_tint)) |
|
|
2572 | { |
|
|
2573 | int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
|
|
2574 | |
|
|
2575 | rgba c; |
|
|
2576 | pix_colors_focused [Color_tint].get (c); |
|
|
2577 | |
|
|
2578 | ShadeXImage (this, image, shade, c.r, c.g, c.b); |
|
|
2579 | } |
|
|
2580 | #endif |
|
|
2581 | |
|
|
2582 | pixmap = XCreatePixmap (dpy, vt, szHint.width, szHint.height, image->depth); |
|
|
2583 | gc = XCreateGC (dpy, vt, 0UL, &gcvalue); |
|
|
2584 | XPutImage (dpy, pixmap, gc, image, 0, 0, |
|
|
2585 | nx, ny, image->width, image->height); |
|
|
2586 | XFreeGC (dpy, gc); |
|
|
2587 | XDestroyImage (image); |
|
|
2588 | XSetWindowBackgroundPixmap (dpy, parent[0], pixmap); |
|
|
2589 | XClearWindow (dpy, parent[0]); |
|
|
2590 | |
|
|
2591 | if (!am_transparent || !am_pixmap_trans) |
|
|
2592 | pchanged = 1; |
|
|
2593 | |
|
|
2594 | am_transparent = am_pixmap_trans = 1; |
|
|
2595 | } |
|
|
2596 | } |
|
|
2597 | |
|
|
2598 | if (am_pixmap_trans) |
|
|
2599 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
|
|
2600 | else |
|
|
2601 | { |
|
|
2602 | unsigned int n; |
|
|
2603 | /* |
|
|
2604 | * InheritPixmap transparency |
|
|
2605 | */ |
|
|
2606 | for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++) |
|
|
2607 | { |
|
|
2608 | oldp = parent[i]; |
|
|
2609 | XQueryTree (dpy, parent[i - 1], &root, &parent[i], &list, &n); |
|
|
2610 | XFree (list); |
|
|
2611 | |
|
|
2612 | if (parent[i] == display->root) |
|
|
2613 | { |
|
|
2614 | if (oldp != None) |
|
|
2615 | pchanged = 1; |
|
|
2616 | |
|
|
2617 | break; |
|
|
2618 | } |
|
|
2619 | |
|
|
2620 | if (oldp != parent[i]) |
|
|
2621 | pchanged = 1; |
|
|
2622 | } |
|
|
2623 | |
|
|
2624 | n = 0; |
|
|
2625 | |
|
|
2626 | if (pchanged) |
|
|
2627 | for (; n < (unsigned int)i; n++) |
|
|
2628 | { |
|
|
2629 | XGetWindowAttributes (dpy, parent[n], &wattr); |
|
|
2630 | |
|
|
2631 | if (wattr.depth != rootdepth || wattr.c_class == InputOnly) |
|
|
2632 | { |
|
|
2633 | n = (int) (sizeof (parent) / sizeof (Window)) + 1; |
|
|
2634 | break; |
|
|
2635 | } |
|
|
2636 | } |
|
|
2637 | |
|
|
2638 | if (n > (sizeof (parent) / sizeof (parent[0]))) |
|
|
2639 | { |
|
|
2640 | XSetWindowBackground (dpy, parent[0], pix_colors_focused[Color_border]); |
|
|
2641 | XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]); |
|
|
2642 | am_transparent = 0; |
|
|
2643 | /* XXX: also turn off Opt_transparent? */ |
|
|
2644 | } |
|
|
2645 | else |
|
|
2646 | { |
|
|
2647 | for (n = 0; n < (unsigned int)i; n++) |
|
|
2648 | { |
|
|
2649 | XSetWindowBackgroundPixmap (dpy, parent[n], ParentRelative); |
|
|
2650 | XClearWindow (dpy, parent[n]); |
|
|
2651 | } |
|
|
2652 | |
|
|
2653 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
|
|
2654 | am_transparent = 1; |
|
|
2655 | } |
|
|
2656 | |
|
|
2657 | for (; i < (int) (sizeof (parent) / sizeof (Window)); i++) |
|
|
2658 | parent[i] = None; |
|
|
2659 | } |
|
|
2660 | |
|
|
2661 | if (scrollBar.win) |
|
|
2662 | { |
|
|
2663 | XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); |
|
|
2664 | scrollBar.setIdle (); |
|
|
2665 | scrollbar_show (0); |
|
|
2666 | } |
|
|
2667 | |
|
|
2668 | if (am_transparent) |
|
|
2669 | { |
|
|
2670 | want_refresh = want_full_refresh = 1; |
|
|
2671 | if (am_pixmap_trans) |
|
|
2672 | flush (); |
|
|
2673 | } |
|
|
2674 | |
|
|
2675 | return pchanged; |
|
|
2676 | } |
|
|
2677 | #endif |
|
|
2678 | |
2238 | |
2679 | /*}}} */ |
2239 | /*}}} */ |
2680 | |
2240 | |
2681 | bool |
2241 | bool |
2682 | rxvt_term::cmd_parse () |
2242 | rxvt_term::cmd_parse () |
… | |
… | |
2731 | if (ch == C0_LF) |
2291 | if (ch == C0_LF) |
2732 | nlines++; |
2292 | nlines++; |
2733 | |
2293 | |
2734 | refresh_count++; |
2294 | refresh_count++; |
2735 | |
2295 | |
2736 | if (!OPTION (Opt_jumpScroll) |
2296 | if (!option (Opt_jumpScroll) |
2737 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2297 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2738 | { |
2298 | { |
2739 | refreshnow = true; |
2299 | refreshnow = true; |
2740 | refresh_count = 0; |
2300 | refresh_count = 0; |
2741 | ch = NOCHAR; |
2301 | ch = NOCHAR; |
… | |
… | |
2781 | * the number of pages between refreshes is refresh_limit, which |
2341 | * the number of pages between refreshes is refresh_limit, which |
2782 | * is incremented here because we must be doing flat-out scrolling. |
2342 | * is incremented here because we must be doing flat-out scrolling. |
2783 | */ |
2343 | */ |
2784 | if (refreshnow) |
2344 | if (refreshnow) |
2785 | { |
2345 | { |
2786 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2346 | if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2787 | refresh_limit++; |
2347 | refresh_limit++; |
2788 | else |
2348 | else |
2789 | { |
2349 | { |
2790 | flag = true; |
2350 | flag = true; |
2791 | //TODO: due to popular request, implement "skipscroll" option here |
2351 | //TODO: due to popular request, implement "skipscroll" option here |
… | |
… | |
2948 | { |
2508 | { |
2949 | if ((buf[len++] = cmd_getc ()) == 'i') |
2509 | if ((buf[len++] = cmd_getc ()) == 'i') |
2950 | break; /* done = 1 */ |
2510 | break; /* done = 1 */ |
2951 | } |
2511 | } |
2952 | } |
2512 | } |
2953 | |
2513 | |
2954 | for (i = 0; i < len; i++) |
2514 | for (i = 0; i < len; i++) |
2955 | if (putc (buf[i], fd) == EOF) |
2515 | if (putc (buf[i], fd) == EOF) |
2956 | { |
2516 | { |
2957 | done = 1; |
2517 | done = 1; |
2958 | break; |
2518 | break; |
… | |
… | |
3457 | break; |
3017 | break; |
3458 | case 6: /* CPR requested */ |
3018 | case 6: /* CPR requested */ |
3459 | scr_report_position (); |
3019 | scr_report_position (); |
3460 | break; |
3020 | break; |
3461 | case 7: /* unofficial extension */ |
3021 | case 7: /* unofficial extension */ |
3462 | if (OPTION (Opt_insecure)) |
3022 | if (option (Opt_insecure)) |
3463 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3023 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3464 | break; |
3024 | break; |
3465 | case 8: /* unofficial extension */ |
3025 | case 8: /* unofficial extension */ |
3466 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3026 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3467 | break; |
3027 | break; |
… | |
… | |
3631 | break; |
3191 | break; |
3632 | case 20: /* report icon label */ |
3192 | case 20: /* report icon label */ |
3633 | { |
3193 | { |
3634 | char *s; |
3194 | char *s; |
3635 | XGetIconName (dpy, parent[0], &s); |
3195 | XGetIconName (dpy, parent[0], &s); |
3636 | tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3196 | tt_printf ("\033]L%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3637 | XFree (s); |
3197 | XFree (s); |
3638 | } |
3198 | } |
3639 | break; |
3199 | break; |
3640 | case 21: /* report window title */ |
3200 | case 21: /* report window title */ |
3641 | { |
3201 | { |
3642 | char *s; |
3202 | char *s; |
3643 | XFetchName (dpy, parent[0], &s); |
3203 | XFetchName (dpy, parent[0], &s); |
3644 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3204 | tt_printf ("\033]l%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3645 | XFree (s); |
3205 | XFree (s); |
3646 | } |
3206 | } |
3647 | break; |
3207 | break; |
3648 | } |
3208 | } |
3649 | } |
3209 | } |
… | |
… | |
3776 | int saveop = op; |
3336 | int saveop = op; |
3777 | |
3337 | |
3778 | dLocal (Display *, dpy); |
3338 | dLocal (Display *, dpy); |
3779 | |
3339 | |
3780 | assert (str != NULL); |
3340 | assert (str != NULL); |
3781 | |
3341 | |
3782 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3342 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3783 | return; |
3343 | return; |
3784 | |
3344 | |
3785 | switch (op) |
3345 | switch (op) |
3786 | { |
3346 | { |
… | |
… | |
3921 | #ifdef XPM_BACKGROUND |
3481 | #ifdef XPM_BACKGROUND |
3922 | resize_pixmap (); |
3482 | resize_pixmap (); |
3923 | scr_touch (true); |
3483 | scr_touch (true); |
3924 | #endif |
3484 | #endif |
3925 | } |
3485 | } |
|
|
3486 | #if TRANSPARENT && defined(HAVE_AFTERIMAGE) |
|
|
3487 | if (option (Opt_transparent)) |
|
|
3488 | check_our_parents (); |
|
|
3489 | #endif |
3926 | } |
3490 | } |
3927 | break; |
3491 | break; |
3928 | |
3492 | |
3929 | case Rxvt_restoreFG: |
3493 | case Rxvt_restoreFG: |
3930 | set_window_color (Color_fg, str); |
3494 | set_window_color (Color_fg, str); |
… | |
… | |
3957 | case URxvt_italicFont: |
3521 | case URxvt_italicFont: |
3958 | case URxvt_boldItalicFont: |
3522 | case URxvt_boldItalicFont: |
3959 | #endif |
3523 | #endif |
3960 | if (query) |
3524 | if (query) |
3961 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3525 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3962 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3526 | option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3963 | ? fontset[op - URxvt_font]->fontdesc : "", |
3527 | ? fontset[op - URxvt_font]->fontdesc : "", |
3964 | resp); |
3528 | resp); |
3965 | else |
3529 | else |
3966 | { |
3530 | { |
3967 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3531 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3981 | break; |
3545 | break; |
3982 | |
3546 | |
3983 | #if !ENABLE_MINIMAL |
3547 | #if !ENABLE_MINIMAL |
3984 | case URxvt_locale: |
3548 | case URxvt_locale: |
3985 | if (query) |
3549 | if (query) |
3986 | tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); |
3550 | tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); |
3987 | else |
3551 | else |
3988 | { |
3552 | { |
3989 | set_locale (str); |
3553 | set_locale (str); |
3990 | pty->set_utf8_mode (enc_utf8); |
3554 | pty->set_utf8_mode (enc_utf8); |
3991 | init_xlocale (); |
3555 | init_xlocale (); |
… | |
… | |
4132 | scr_touch (true); |
3696 | scr_touch (true); |
4133 | break; |
3697 | break; |
4134 | #endif |
3698 | #endif |
4135 | case 1048: /* alternative cursor save */ |
3699 | case 1048: /* alternative cursor save */ |
4136 | case 1049: |
3700 | case 1049: |
4137 | if (OPTION (Opt_secondaryScreen)) |
3701 | if (option (Opt_secondaryScreen)) |
4138 | if (mode == 0) |
3702 | if (mode == 0) |
4139 | scr_cursor (RESTORE); |
3703 | scr_cursor (RESTORE); |
4140 | else if (mode == 1) |
3704 | else if (mode == 1) |
4141 | scr_cursor (SAVE); |
3705 | scr_cursor (SAVE); |
4142 | break; |
3706 | break; |
… | |
… | |
4207 | break; |
3771 | break; |
4208 | case 1011: /* scroll to bottom on key press */ |
3772 | case 1011: /* scroll to bottom on key press */ |
4209 | set_option (Opt_scrollTtyKeypress, state); |
3773 | set_option (Opt_scrollTtyKeypress, state); |
4210 | break; |
3774 | break; |
4211 | case 1047: /* secondary screen w/ clearing last */ |
3775 | case 1047: /* secondary screen w/ clearing last */ |
4212 | if (OPTION (Opt_secondaryScreen)) |
3776 | if (option (Opt_secondaryScreen)) |
4213 | if (current_screen != PRIMARY) |
3777 | if (current_screen != PRIMARY) |
4214 | scr_erase_screen (2); |
3778 | scr_erase_screen (2); |
4215 | scr_change_screen (state); |
3779 | scr_change_screen (state); |
4216 | break; |
3780 | break; |
4217 | case 1049: /* secondary screen w/ clearing first */ |
3781 | case 1049: /* secondary screen w/ clearing first */ |
4218 | scr_change_screen (state); |
3782 | scr_change_screen (state); |
4219 | if (OPTION (Opt_secondaryScreen)) |
3783 | if (option (Opt_secondaryScreen)) |
4220 | if (current_screen != PRIMARY) |
3784 | if (current_screen != PRIMARY) |
4221 | scr_erase_screen (2); |
3785 | scr_erase_screen (2); |
4222 | break; |
3786 | break; |
4223 | default: |
3787 | default: |
4224 | break; |
3788 | break; |