ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.328 by ayin, Mon Jun 11 17:40:15 2007 UTC vs.
Revision 1.355 by ayin, Fri Sep 14 09:46:18 2007 UTC

95 XK_Shift_L, 0x21e7, 95 XK_Shift_L, 0x21e7,
96 XK_Shift_R, 0x21e7, 96 XK_Shift_R, 0x21e7,
97 97
98 XK_Shift_Lock, 0x21eb, 98 XK_Shift_Lock, 0x21eb,
99 XK_ISO_Lock, 0x21eb, 99 XK_ISO_Lock, 0x21eb,
100 XK_ISO_Lock, 0x21eb,
101 XK_Caps_Lock, 0x21ec, 100 XK_Caps_Lock, 0x21ec,
102 XK_Num_Lock, 0x21ed, 101 XK_Num_Lock, 0x21ed,
103 XK_ISO_Level3_Shift, 0x21ee, 102 XK_ISO_Level3_Shift, 0x21ee,
104 XK_ISO_Level3_Lock, 0x21ef, 103 XK_ISO_Level3_Lock, 0x21ef,
105 XK_ISO_Group_Lock, 0x21f0, 104 XK_ISO_Group_Lock, 0x21f0,
519# endif 518# endif
520 return; 519 return;
521 } 520 }
522 else 521 else
523 { 522 {
524# if ENABLE_OVERLAY 523# if ISO_14755
525 scr_overlay_off (); 524 scr_overlay_off ();
526# endif 525# endif
527 iso14755buf = 0; 526 iso14755buf = 0;
528 } 527 }
529 } 528 }
530 else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) 529 else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R))
531 || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) 530 || (shft && (keysym == XK_Control_L || keysym == XK_Control_R)))
532 if (!(iso14755buf & ISO_14755_STARTED)) 531 if (!(iso14755buf & ISO_14755_STARTED))
533 { 532 {
534 iso14755buf |= ISO_14755_STARTED; 533 iso14755buf |= ISO_14755_STARTED;
535# if ENABLE_OVERLAY 534# if ISO_14755
536 scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); 535 scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1);
537 scr_overlay_set (0, 0, "ISO 14755 mode"); 536 scr_overlay_set (0, 0, "ISO 14755 mode");
538# endif 537# endif
539 } 538 }
540#endif 539#endif
541 540
542#ifdef PRINTPIPE 541#ifdef PRINTPIPE
543 if (keysym == XK_Print) 542 if (keysym == XK_Print)
544 { 543 {
545 scr_printscreen (ctrl | shft); 544 scr_printscreen (ctrl | shft);
546 return; 545 return;
548#endif 547#endif
549 548
550 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 549 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
551 { 550 {
552 { 551 {
552 bool kp = priv_modes & PrivMode_aplKP ? !shft : shft;
553 newlen = 1; 553 newlen = 1;
554 switch (keysym) 554 switch (keysym)
555 { 555 {
556#ifndef NO_BACKSPACE_KEY 556#ifndef NO_BACKSPACE_KEY
557 case XK_BackSpace: 557 case XK_BackSpace:
560 kbuf[0] = (!! (priv_modes & PrivMode_BackSpace) 560 kbuf[0] = (!! (priv_modes & PrivMode_BackSpace)
561 ^ !!ctrl) ? '\b' : '\177'; 561 ^ !!ctrl) ? '\b' : '\177';
562 kbuf[1] = '\0'; 562 kbuf[1] = '\0';
563 } 563 }
564 else 564 else
565 strcpy (kbuf, key_backspace); 565 strcpy (kbuf, rs[Rs_backspace_key]);
566 break; 566 break;
567#endif 567#endif
568#ifndef NO_DELETE_KEY 568#ifndef NO_DELETE_KEY
569# ifdef XK_KP_Prior 569# ifdef XK_KP_Delete
570 case XK_KP_Delete: 570 case XK_KP_Delete:
571 /* allow shift to override */ 571 /* allow shift to override */
572 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 572 if (kp)
573 { 573 {
574 strcpy (kbuf, "\033On"); 574 strcpy (kbuf, "\033On");
575 break; 575 break;
576 } 576 }
577 /* FALLTHROUGH */ 577 /* FALLTHROUGH */
578# endif 578# endif
579 case XK_Delete: 579 case XK_Delete:
580 strcpy (kbuf, key_delete); 580 strcpy (kbuf, rs[Rs_delete_key]);
581 break; 581 break;
582#endif 582#endif
583 case XK_Tab: 583 case XK_Tab:
584 if (shft) 584 if (shft)
585 strcpy (kbuf, "\033[Z"); 585 strcpy (kbuf, "\033[Z");
600#ifdef XK_KP_Left 600#ifdef XK_KP_Left
601 case XK_KP_Up: /* \033Ox or standard */ 601 case XK_KP_Up: /* \033Ox or standard */
602 case XK_KP_Down: /* \033Or or standard */ 602 case XK_KP_Down: /* \033Or or standard */
603 case XK_KP_Right: /* \033Ov or standard */ 603 case XK_KP_Right: /* \033Ov or standard */
604 case XK_KP_Left: /* \033Ot or standard */ 604 case XK_KP_Left: /* \033Ot or standard */
605 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 605 if (kp)
606 { 606 {
607 strcpy (kbuf, "\033OZ"); 607 strcpy (kbuf, "\033OZ");
608 kbuf[2] = "txvr"[keysym - XK_KP_Left]; 608 kbuf[2] = "txvr"[keysym - XK_KP_Left];
609 break; 609 break;
610 } 610 }
633 633
634#ifndef UNSHIFTED_SCROLLKEYS 634#ifndef UNSHIFTED_SCROLLKEYS
635# ifdef XK_KP_Prior 635# ifdef XK_KP_Prior
636 case XK_KP_Prior: 636 case XK_KP_Prior:
637 /* allow shift to override */ 637 /* allow shift to override */
638 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 638 if (kp)
639 { 639 {
640 strcpy (kbuf, "\033Oy"); 640 strcpy (kbuf, "\033Oy");
641 break; 641 break;
642 } 642 }
643 /* FALLTHROUGH */ 643 /* FALLTHROUGH */
646 strcpy (kbuf, "\033[5~"); 646 strcpy (kbuf, "\033[5~");
647 break; 647 break;
648# ifdef XK_KP_Next 648# ifdef XK_KP_Next
649 case XK_KP_Next: 649 case XK_KP_Next:
650 /* allow shift to override */ 650 /* allow shift to override */
651 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 651 if (kp)
652 { 652 {
653 strcpy (kbuf, "\033Os"); 653 strcpy (kbuf, "\033Os");
654 break; 654 break;
655 } 655 }
656 /* FALLTHROUGH */ 656 /* FALLTHROUGH */
659 strcpy (kbuf, "\033[6~"); 659 strcpy (kbuf, "\033[6~");
660 break; 660 break;
661#endif 661#endif
662 case XK_KP_Enter: 662 case XK_KP_Enter:
663 /* allow shift to override */ 663 /* allow shift to override */
664 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 664 if (kp)
665 { 665 {
666 strcpy (kbuf, "\033OM"); 666 strcpy (kbuf, "\033OM");
667 break; 667 break;
668 } 668 }
669 669
712 case XK_KP_6: /* "\033Ov" : "6" */ 712 case XK_KP_6: /* "\033Ov" : "6" */
713 case XK_KP_7: /* "\033Ow" : "7" */ 713 case XK_KP_7: /* "\033Ow" : "7" */
714 case XK_KP_8: /* "\033Ox" : "8" */ 714 case XK_KP_8: /* "\033Ox" : "8" */
715 case XK_KP_9: /* "\033Oy" : "9" */ 715 case XK_KP_9: /* "\033Oy" : "9" */
716 /* allow shift to override */ 716 /* allow shift to override */
717 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 717 if (kp)
718 { 718 {
719 strcpy (kbuf, "\033Oj"); 719 strcpy (kbuf, "\033Oj");
720 kbuf[2] += (keysym - XK_KP_Multiply); 720 kbuf[2] += (keysym - XK_KP_Multiply);
721 } 721 }
722 else 722 else
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 (kp)
737 { 737 {
738 strcpy (kbuf, "\033Op"); 738 strcpy (kbuf, "\033Op");
739 break; 739 break;
740 } 740 }
741 /* FALLTHROUGH */ 741 /* FALLTHROUGH */
754 strcpy (kbuf, "\033[4~"); 754 strcpy (kbuf, "\033[4~");
755 break; 755 break;
756#ifdef XK_KP_End 756#ifdef XK_KP_End
757 case XK_KP_End: 757 case XK_KP_End:
758 /* allow shift to override */ 758 /* allow shift to override */
759 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 759 if (kp)
760 { 760 {
761 strcpy (kbuf, "\033Oq"); 761 strcpy (kbuf, "\033Oq");
762 break; 762 break;
763 } 763 }
764 /* FALLTHROUGH */ 764 /* FALLTHROUGH */
767 strcpy (kbuf, KS_END); 767 strcpy (kbuf, KS_END);
768 break; 768 break;
769#ifdef XK_KP_Home 769#ifdef XK_KP_Home
770 case XK_KP_Home: 770 case XK_KP_Home:
771 /* allow shift to override */ 771 /* allow shift to override */
772 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 772 if (kp)
773 { 773 {
774 strcpy (kbuf, "\033Ow"); 774 strcpy (kbuf, "\033Ow");
775 break; 775 break;
776 } 776 }
777 /* FALLTHROUGH */ 777 /* FALLTHROUGH */
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
1034 1034
1035void 1035void
1036rxvt_term::flush () 1036rxvt_term::flush ()
1037{ 1037{
1038 flush_ev.stop (); 1038 flush_ev.stop ();
1039
1040#ifdef TRANSPARENT
1041 if (want_full_refresh)
1042 {
1043 want_full_refresh = 0;
1044 scr_clear ();
1045 scr_touch (false);
1046 }
1047#endif
1048 1039
1049 if (want_refresh) 1040 if (want_refresh)
1050 { 1041 {
1051 if (SHOULD_INVOKE (HOOK_LINE_UPDATE)) 1042 if (SHOULD_INVOKE (HOOK_LINE_UPDATE))
1052 { 1043 {
1110void 1101void
1111rxvt_term::flush_cb (time_watcher &w) 1102rxvt_term::flush_cb (time_watcher &w)
1112{ 1103{
1113 make_current (); 1104 make_current ();
1114 1105
1115 refresh_limit = 1;
1116 refresh_count = 0; 1106 refresh_count = 0;
1117 flush (); 1107 flush ();
1118} 1108}
1119 1109
1120#ifdef CURSOR_BLINK 1110#ifdef CURSOR_BLINK
1186 1176
1187#if LINUX_YIELD_HACK 1177#if LINUX_YIELD_HACK
1188static struct event_handler 1178static struct event_handler
1189{ 1179{
1190 check_watcher yield_ev; 1180 check_watcher yield_ev;
1191 1181
1192 void yield_cb (check_watcher &w) 1182 void yield_cb (check_watcher &w)
1193 { 1183 {
1194 // this should really be sched_yield(), but the linux guys thought 1184 // this should really be sched_yield(), but the linux guys thought
1195 // that giving a process calling sched_yield () less cpu time than 1185 // 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 1186 // ones with high nice levels is a useful thing to do. It surely is is
1243 pty_ev.stop (); 1233 pty_ev.stop ();
1244 1234
1245 if (!option (Opt_hold)) 1235 if (!option (Opt_hold))
1246 destroy (); 1236 destroy ();
1247 } 1237 }
1248 1238
1249 return false; 1239 return false;
1250} 1240}
1251 1241
1252void 1242void
1253rxvt_term::pty_cb (io_watcher &w, short revents) 1243rxvt_term::pty_cb (io_watcher &w, short revents)
1434 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) 1424 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT)
1435 focus_out (); 1425 focus_out ();
1436 } 1426 }
1437#endif 1427#endif
1438 } 1428 }
1439 break;
1440
1441 case MappingNotify:
1442 XRefreshKeyboardMapping (&ev.xmapping);
1443 break; 1429 break;
1444 1430
1445 /* 1431 /*
1446 * XXX: this is not the _current_ arrangement 1432 * XXX: this is not the _current_ arrangement
1447 * Here's my conclusion: 1433 * Here's my conclusion:
1480 && ev.xfocus.mode != NotifyGrab) 1466 && ev.xfocus.mode != NotifyGrab)
1481 focus_out (); 1467 focus_out ();
1482 break; 1468 break;
1483 1469
1484 case ConfigureNotify: 1470 case ConfigureNotify:
1471/* fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n",
1472 ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y,
1473 szHint.width, szHint.height);*/
1485 if (ev.xconfigure.window == parent[0]) 1474 if (ev.xconfigure.window == parent[0])
1486 { 1475 {
1487 while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) 1476 while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev))
1488 ; 1477 ;
1489 1478
1490 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) 1479 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height)
1491 { 1480 {
1492 seen_resize = 1; 1481 seen_resize = 1;
1493 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); 1482 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
1501 } 1483 }
1502 1484 else
1485 {
1486#ifdef HAVE_BG_PIXMAP
1487 if (bgPixmap.window_position_sensitive ())
1488 update_background ();
1489#endif
1490 }
1503 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1491 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1504
1505#ifdef TRANSPARENT
1506 if (option (Opt_transparent))
1507 check_our_parents ();
1508#endif
1509 } 1492 }
1510 break; 1493 break;
1511 1494
1512 case PropertyNotify: 1495 case PropertyNotify:
1513 if (!HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END))) 1496 if (!HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END)))
1543#ifdef TEXT_BLINK 1526#ifdef TEXT_BLINK
1544 text_blink_ev.stop (); 1527 text_blink_ev.stop ();
1545#endif 1528#endif
1546 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1529 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1547 break; 1530 break;
1548
1549#ifdef TRANSPARENT
1550 case ReparentNotify:
1551 rootwin_cb (ev);
1552 break;
1553#endif /* TRANSPARENT */
1554 1531
1555 case GraphicsExpose: 1532 case GraphicsExpose:
1556 case Expose: 1533 case Expose:
1557 if (ev.xany.window == vt) 1534 if (ev.xany.window == vt)
1558 { 1535 {
1581 if (isScrollbarWindow (ev.xany.window)) 1558 if (isScrollbarWindow (ev.xany.window))
1582 { 1559 {
1583 scrollBar.setIdle (); 1560 scrollBar.setIdle ();
1584 scrollbar_show (0); 1561 scrollbar_show (0);
1585 } 1562 }
1586
1587#ifdef TRANSPARENT
1588 if (am_transparent && ev.xany.window == parent[0])
1589 XClearWindow (dpy, ev.xany.window);
1590#endif
1591 } 1563 }
1592 break; 1564 break;
1593 1565
1594 case MotionNotify: 1566 case MotionNotify:
1595#ifdef POINTER_BLANK 1567#ifdef POINTER_BLANK
1693 &ev.xbutton.x, &ev.xbutton.y, 1665 &ev.xbutton.x, &ev.xbutton.y,
1694 &unused_mask); 1666 &unused_mask);
1695 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, 1667 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO,
1696 scrollbar_size ()); 1668 scrollbar_size ());
1697 want_refresh = 1; 1669 want_refresh = 1;
1698 refresh_limit = 0;
1699 scrollbar_show (1); 1670 scrollbar_show (1);
1700 } 1671 }
1701 break; 1672 break;
1702 } 1673 }
1703 1674
1785 1756
1786#if ENABLE_FRILLS || ISO_14755 1757#if ENABLE_FRILLS || ISO_14755
1787 if (iso14755buf) 1758 if (iso14755buf)
1788 { 1759 {
1789 iso14755buf = 0; 1760 iso14755buf = 0;
1790# if ENABLE_OVERLAY 1761# if ISO_14755
1791 scr_overlay_off (); 1762 scr_overlay_off ();
1792# endif 1763# endif
1793 } 1764 }
1794#endif 1765#endif
1795#if USE_XIM 1766#if USE_XIM
1822 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); 1793 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
1823 } 1794 }
1824#endif 1795#endif
1825} 1796}
1826 1797
1827#if TRANSPARENT || ENABLE_PERL 1798#if ENABLE_TRANSPARENCY || ENABLE_PERL
1828void 1799void
1829rxvt_term::rootwin_cb (XEvent &ev) 1800rxvt_term::rootwin_cb (XEvent &ev)
1830{ 1801{
1831 make_current (); 1802 make_current ();
1832 1803
1833 if (SHOULD_INVOKE (HOOK_ROOT_EVENT) 1804 if (SHOULD_INVOKE (HOOK_ROOT_EVENT)
1834 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) 1805 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END)))
1835 return; 1806 return;
1836 1807
1837# if TRANSPARENT 1808# if ENABLE_TRANSPARENCY
1838 switch (ev.type) 1809 switch (ev.type)
1839 { 1810 {
1840 case PropertyNotify: 1811 case PropertyNotify:
1841 /* 1812 /*
1842 * if user used some Esetroot compatible prog to set the root bg, 1813 * if user used some Esetroot compatible prog to set the root bg,
1843 * use the property to determine the pixmap. We use it later on. 1814 * use the property to determine the pixmap. We use it later on.
1844 */ 1815 */
1845 if (ev.xproperty.atom != xa[XA_XROOTPMAP_ID] 1816 if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID]
1846 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) 1817 || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID])
1847 return; 1818 {
1848 1819 bgPixmap.set_root_pixmap ();
1849 /* FALLTHROUGH */ 1820 update_background ();
1850 case ReparentNotify: 1821 }
1851 if (option (Opt_transparent))
1852 check_our_parents ();
1853 break; 1822 break;
1854 } 1823 }
1855# endif 1824# endif
1856} 1825}
1857#endif 1826#endif
2291 if (ch == C0_LF) 2260 if (ch == C0_LF)
2292 nlines++; 2261 nlines++;
2293 2262
2294 refresh_count++; 2263 refresh_count++;
2295 2264
2296 if (!option (Opt_jumpScroll) 2265 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1)
2297 || (refresh_count >= refresh_limit * (nrow - 1)))
2298 { 2266 {
2299 refreshnow = true;
2300 refresh_count = 0; 2267 refresh_count = 0;
2268
2269 if (!option (Opt_skipScroll) || io_manager::now () > NOW + 1. / 60.)
2270 {
2271 refreshnow = true;
2301 ch = NOCHAR; 2272 ch = NOCHAR;
2302 break; 2273 break;
2274 }
2303 } 2275 }
2304 2276
2305 // scr_add_lines only works for nlines <= nrow - 1. 2277 // scr_add_lines only works for nlines <= nrow - 1.
2306 if (nlines >= nrow - 1) 2278 if (nlines >= nrow - 1)
2307 { 2279 {
2335 && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) 2307 && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END))))
2336 scr_add_lines (buf, str - buf, nlines); 2308 scr_add_lines (buf, str - buf, nlines);
2337 2309
2338 /* 2310 /*
2339 * If there have been a lot of new lines, then update the screen 2311 * 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. 2312 * 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 2313 * if skipScroll is enabled.
2342 * is incremented here because we must be doing flat-out scrolling.
2343 */ 2314 */
2344 if (refreshnow) 2315 if (refreshnow)
2345 { 2316 {
2346 if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
2347 refresh_limit++;
2348 else
2349 {
2350 flag = true; 2317 flag = true;
2351 //TODO: due to popular request, implement "skipscroll" option here
2352 scr_refresh (); 2318 scr_refresh ();
2353 want_refresh = 1; 2319 want_refresh = 1;
2354 }
2355 } 2320 }
2356 2321
2357 } 2322 }
2358 else 2323 else
2359 { 2324 {
2508 { 2473 {
2509 if ((buf[len++] = cmd_getc ()) == 'i') 2474 if ((buf[len++] = cmd_getc ()) == 'i')
2510 break; /* done = 1 */ 2475 break; /* done = 1 */
2511 } 2476 }
2512 } 2477 }
2513 2478
2514 for (i = 0; i < len; i++) 2479 for (i = 0; i < len; i++)
2515 if (putc (buf[i], fd) == EOF) 2480 if (putc (buf[i], fd) == EOF)
2516 { 2481 {
2517 done = 1; 2482 done = 1;
2518 break; 2483 break;
2580 process_dcs_seq (); 2545 process_dcs_seq ();
2581 break; 2546 break;
2582 case 0x9b: /* CSI */ 2547 case 0x9b: /* CSI */
2583 process_csi_seq (); 2548 process_csi_seq ();
2584 break; 2549 break;
2585 case 0x9d: /* CSI */ 2550 case 0x9d: /* OSC */
2586 process_osc_seq (); 2551 process_osc_seq ();
2587 break; 2552 break;
2588#endif 2553#endif
2589 } 2554 }
2590} 2555}
2816rxvt_term::process_csi_seq () 2781rxvt_term::process_csi_seq ()
2817{ 2782{
2818 unicode_t ch, priv, i; 2783 unicode_t ch, priv, i;
2819 unsigned int nargs, p; 2784 unsigned int nargs, p;
2820 int n, ndef; 2785 int n, ndef;
2821 int arg[ESC_ARGS]; 2786 int arg[ESC_ARGS] = { };
2822 2787
2823 for (nargs = ESC_ARGS; nargs > 0;) 2788 nargs = 0;
2824 arg[--nargs] = 0;
2825 2789
2826 priv = 0; 2790 priv = 0;
2827 ch = cmd_getc (); 2791 ch = cmd_getc ();
2828 if (ch >= '<' && ch <= '?') 2792 if (ch >= '<' && ch <= '?')
2829 { /* '<' '=' '>' '?' */ 2793 { /* '<' '=' '>' '?' */
2873 switch (priv) 2837 switch (priv)
2874 { 2838 {
2875 case '>': 2839 case '>':
2876 if (ch == CSI_DA) /* secondary device attributes */ 2840 if (ch == CSI_DA) /* secondary device attributes */
2877 { 2841 {
2878 // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, 2842 // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt,
2879 // 'U' for rxvt-unicode != 7.[34] (where it was broken). 2843 // 'U' for rxvt-unicode != 7.[34] (where it was broken).
2880 // 2844 //
2881 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt 2845 // 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 2846 // 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). 2847 // that we do not support xterm mouse reporting (should be 95 when we do).
3336 int saveop = op; 3300 int saveop = op;
3337 3301
3338 dLocal (Display *, dpy); 3302 dLocal (Display *, dpy);
3339 3303
3340 assert (str != NULL); 3304 assert (str != NULL);
3341 3305
3342 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) 3306 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END)))
3343 return; 3307 return;
3344 3308
3345 switch (op) 3309 switch (op)
3346 { 3310 {
3441 break; 3405 break;
3442 case URxvt_Color_IT: 3406 case URxvt_Color_IT:
3443 process_color_seq (op, Color_IT, str, resp); 3407 process_color_seq (op, Color_IT, str, resp);
3444 break; 3408 break;
3445#endif 3409#endif
3446#if TRANSPARENT && TINTING 3410#if ENABLE_TRANSPARENCY
3447 case URxvt_Color_tint: 3411 case URxvt_Color_tint:
3448 process_color_seq (op, Color_tint, str, resp); 3412 process_color_seq (op, Color_tint, str, resp);
3413 {
3414 bool changed = false;
3415 if (ISSET_PIXCOLOR (Color_tint))
3416 changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]);
3417 else
3418 changed = bgPixmap.unset_tint ();
3419 if (changed)
3420 update_background ();
3421 }
3449 3422
3450 check_our_parents ();
3451
3452 if (am_transparent)
3453 want_full_refresh = want_refresh = 1;
3454
3455 break; 3423 break;
3456#endif 3424#endif
3457 3425
3426#if BG_IMAGE_FROM_FILE
3458 case Rxvt_Pixmap: 3427 case Rxvt_Pixmap:
3459 { 3428 if (!strcmp (str, "?"))
3460 if (*str != ';')
3461 { 3429 {
3462#if XPM_BACKGROUND 3430 char str[256];
3463 scale_pixmap (""); /* reset to default scaling */ 3431
3464 set_bgPixmap (str); /* change pixmap */ 3432 sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */
3465 scr_touch (true); 3433 min (bgPixmap.h_scale, 32767), min (bgPixmap.v_scale, 32767),
3466#endif 3434 min (bgPixmap.h_align, 32767), min (bgPixmap.v_align, 32767));
3435 process_xterm_seq (XTerm_title, str, CHAR_ST);
3467 } 3436 }
3468 3437 else
3438 {
3469 int changed = 0; 3439 int changed = 0;
3470 3440
3471 while ((str = strchr (str, ';')) != NULL) 3441 if (*str != ';')
3472 { 3442 {
3443 /* reset to default scaling :*/
3444 bgPixmap.unset_geometry ();
3445 if (bgPixmap.set_file (str)) /* change pixmap */
3446 changed++;
3447 str = strchr (str, ';');
3448 if (str == NULL)
3449 bgPixmap.set_defaultGeometry ();
3450 }
3451 while (str)
3452 {
3473 str++; 3453 str++;
3474#if XPM_BACKGROUND 3454 if (bgPixmap.set_geometry (str))
3475 changed += scale_pixmap (str); 3455 changed++;
3476#endif 3456 str = strchr (str, ';');
3477 } 3457 }
3478
3479 if (changed) 3458 if (changed)
3480 { 3459 update_background ();
3481#ifdef XPM_BACKGROUND
3482 resize_pixmap ();
3483 scr_touch (true);
3484#endif
3485 } 3460 }
3486#if TRANSPARENT && defined(HAVE_AFTERIMAGE) 3461 break;
3487 if (option(Opt_transparent))
3488 check_our_parents ();
3489#endif 3462#endif
3490
3491 }
3492 break;
3493 3463
3494 case Rxvt_restoreFG: 3464 case Rxvt_restoreFG:
3495 set_window_color (Color_fg, str); 3465 set_window_color (Color_fg, str);
3496 break; 3466 break;
3497 case Rxvt_restoreBG: 3467 case Rxvt_restoreBG:
3619{ 3589{
3620 unsigned int i, j; 3590 unsigned int i, j;
3621 int state; 3591 int state;
3622 3592
3623 static const struct 3593 static const struct
3624 { 3594 {
3625 const int argval; 3595 const int argval;
3626 const unsigned long bit; 3596 const unsigned long bit;
3627 }
3628
3629 argtopriv[] = { 3597 } argtopriv[] = {
3630 { 1, PrivMode_aplCUR }, 3598 { 1, PrivMode_aplCUR },
3631 { 2, PrivMode_vt52 }, 3599 { 2, PrivMode_vt52 },
3632 { 3, PrivMode_132 }, 3600 { 3, PrivMode_132 },
3633 { 4, PrivMode_smoothScroll }, 3601 { 4, PrivMode_smoothScroll },
3634 { 5, PrivMode_rVideo }, 3602 { 5, PrivMode_rVideo },
4026 3994
4027 if (v_buflen == 0) 3995 if (v_buflen == 0)
4028 { 3996 {
4029 free (v_buffer); 3997 free (v_buffer);
4030 v_buffer = 0; 3998 v_buffer = 0;
4031 v_buflen = 0;
4032 3999
4033 pty_ev.set (EVENT_READ); 4000 pty_ev.set (EVENT_READ);
4034 return; 4001 return;
4035 } 4002 }
4036 4003

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines