… | |
… | |
419 | meta = ev.state & ModMetaMask; |
419 | meta = ev.state & ModMetaMask; |
420 | |
420 | |
421 | if (numlock_state || (ev.state & ModNumLockMask)) |
421 | if (numlock_state || (ev.state & ModNumLockMask)) |
422 | { |
422 | { |
423 | numlock_state = (ev.state & ModNumLockMask); |
423 | numlock_state = (ev.state & ModNumLockMask); |
424 | PrivMode ((!numlock_state), PrivMode_aplKP); |
424 | set_privmode (PrivMode_aplKP, !numlock_state); |
425 | } |
425 | } |
426 | |
426 | |
427 | kbuf[0] = 0; |
427 | kbuf[0] = 0; |
428 | |
428 | |
429 | #ifdef USE_XIM |
429 | #ifdef USE_XIM |
… | |
… | |
641 | } |
641 | } |
642 | #endif |
642 | #endif |
643 | |
643 | |
644 | if (keysym >= 0xFF00 && keysym <= 0xFFFF) |
644 | if (keysym >= 0xFF00 && keysym <= 0xFFFF) |
645 | { |
645 | { |
646 | bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; |
646 | bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; |
647 | unsigned int newlen = 1; |
647 | unsigned int newlen = 1; |
648 | |
648 | |
649 | switch (translate_keypad (keysym, kp)) |
649 | switch (translate_keypad (keysym, kp)) |
|
|
650 | { |
|
|
651 | #ifndef NO_BACKSPACE_KEY |
|
|
652 | case XK_BackSpace: |
|
|
653 | if (priv_modes & PrivMode_HaveBackSpace) |
|
|
654 | { |
|
|
655 | kbuf[0] = (!! (priv_modes & PrivMode_BackSpace) |
|
|
656 | ^ !!ctrl) ? '\b' : '\177'; |
|
|
657 | kbuf[1] = '\0'; |
|
|
658 | } |
|
|
659 | else |
|
|
660 | strcpy (kbuf, rs[Rs_backspace_key]); |
|
|
661 | break; |
|
|
662 | #endif |
|
|
663 | #ifndef NO_DELETE_KEY |
|
|
664 | case XK_Delete: |
|
|
665 | strcpy (kbuf, rs[Rs_delete_key]); |
|
|
666 | break; |
|
|
667 | #endif |
|
|
668 | case XK_Tab: |
|
|
669 | if (shft) |
|
|
670 | strcpy (kbuf, "\033[Z"); |
|
|
671 | else |
|
|
672 | { |
|
|
673 | #ifdef CTRL_TAB_MAKES_META |
|
|
674 | if (ctrl) |
|
|
675 | meta = 1; |
|
|
676 | #endif |
|
|
677 | #ifdef MOD4_TAB_MAKES_META |
|
|
678 | if (ev.state & Mod4Mask) |
|
|
679 | meta = 1; |
|
|
680 | #endif |
|
|
681 | newlen = 0; |
|
|
682 | } |
|
|
683 | break; |
|
|
684 | |
|
|
685 | case XK_Up: /* "\033[A" */ |
|
|
686 | case XK_Down: /* "\033[B" */ |
|
|
687 | case XK_Right: /* "\033[C" */ |
|
|
688 | case XK_Left: /* "\033[D" */ |
|
|
689 | strcpy (kbuf, "\033[Z"); |
|
|
690 | kbuf[2] = "DACB"[keysym - XK_Left]; |
|
|
691 | /* do Shift first */ |
|
|
692 | if (shft) |
|
|
693 | kbuf[2] = "dacb"[keysym - XK_Left]; |
|
|
694 | else if (ctrl) |
|
|
695 | { |
|
|
696 | kbuf[1] = 'O'; |
|
|
697 | kbuf[2] = "dacb"[keysym - XK_Left]; |
|
|
698 | } |
|
|
699 | else if (priv_modes & PrivMode_aplCUR) |
|
|
700 | kbuf[1] = 'O'; |
|
|
701 | break; |
|
|
702 | |
|
|
703 | case XK_KP_Enter: |
|
|
704 | /* allow shift to override */ |
|
|
705 | if (kp) |
|
|
706 | { |
|
|
707 | strcpy (kbuf, "\033OM"); |
|
|
708 | break; |
|
|
709 | } |
|
|
710 | |
|
|
711 | /* FALLTHROUGH */ |
|
|
712 | |
|
|
713 | case XK_Return: |
|
|
714 | if (priv_modes & PrivMode_LFNL) |
|
|
715 | { |
|
|
716 | kbuf[0] = '\015'; |
|
|
717 | kbuf[1] = '\012'; |
|
|
718 | kbuf[2] = '\0'; |
|
|
719 | } |
|
|
720 | else |
|
|
721 | { |
|
|
722 | kbuf[0] = '\015'; |
|
|
723 | kbuf[1] = '\0'; |
|
|
724 | } |
|
|
725 | break; |
|
|
726 | |
|
|
727 | case XK_KP_F1: /* "\033OP" */ |
|
|
728 | case XK_KP_F2: /* "\033OQ" */ |
|
|
729 | case XK_KP_F3: /* "\033OR" */ |
|
|
730 | case XK_KP_F4: /* "\033OS" */ |
|
|
731 | strcpy (kbuf, "\033OP"); |
|
|
732 | kbuf[2] += (keysym - XK_KP_F1); |
|
|
733 | break; |
|
|
734 | |
|
|
735 | case XK_KP_Multiply: /* "\033Oj" : "*" */ |
|
|
736 | case XK_KP_Add: /* "\033Ok" : "+" */ |
|
|
737 | case XK_KP_Separator: /* "\033Ol" : "," */ |
|
|
738 | case XK_KP_Subtract: /* "\033Om" : "-" */ |
|
|
739 | case XK_KP_Decimal: /* "\033On" : "." */ |
|
|
740 | case XK_KP_Divide: /* "\033Oo" : "/" */ |
|
|
741 | case XK_KP_0: /* "\033Op" : "0" */ |
|
|
742 | case XK_KP_1: /* "\033Oq" : "1" */ |
|
|
743 | case XK_KP_2: /* "\033Or" : "2" */ |
|
|
744 | case XK_KP_3: /* "\033Os" : "3" */ |
|
|
745 | case XK_KP_4: /* "\033Ot" : "4" */ |
|
|
746 | case XK_KP_5: /* "\033Ou" : "5" */ |
|
|
747 | case XK_KP_6: /* "\033Ov" : "6" */ |
|
|
748 | case XK_KP_7: /* "\033Ow" : "7" */ |
|
|
749 | case XK_KP_8: /* "\033Ox" : "8" */ |
|
|
750 | case XK_KP_9: /* "\033Oy" : "9" */ |
|
|
751 | /* allow shift to override */ |
|
|
752 | if (kp) |
|
|
753 | { |
|
|
754 | strcpy (kbuf, "\033Oj"); |
|
|
755 | kbuf[2] += (keysym - XK_KP_Multiply); |
|
|
756 | } |
|
|
757 | else |
|
|
758 | { |
|
|
759 | kbuf[0] = ('*' + (keysym - XK_KP_Multiply)); |
|
|
760 | kbuf[1] = '\0'; |
|
|
761 | } |
|
|
762 | break; |
|
|
763 | |
|
|
764 | default: |
650 | { |
765 | { |
651 | #ifndef NO_BACKSPACE_KEY |
|
|
652 | case XK_BackSpace: |
|
|
653 | if (priv_modes & PrivMode_HaveBackSpace) |
|
|
654 | { |
|
|
655 | kbuf[0] = (!! (priv_modes & PrivMode_BackSpace) |
|
|
656 | ^ !!ctrl) ? '\b' : '\177'; |
|
|
657 | kbuf[1] = '\0'; |
|
|
658 | } |
|
|
659 | else |
|
|
660 | strcpy (kbuf, rs[Rs_backspace_key]); |
|
|
661 | break; |
|
|
662 | #endif |
|
|
663 | #ifndef NO_DELETE_KEY |
|
|
664 | case XK_Delete: |
|
|
665 | strcpy (kbuf, rs[Rs_delete_key]); |
|
|
666 | break; |
|
|
667 | #endif |
|
|
668 | case XK_Tab: |
|
|
669 | if (shft) |
|
|
670 | strcpy (kbuf, "\033[Z"); |
|
|
671 | else |
|
|
672 | { |
|
|
673 | #ifdef CTRL_TAB_MAKES_META |
|
|
674 | if (ctrl) |
|
|
675 | meta = 1; |
|
|
676 | #endif |
|
|
677 | #ifdef MOD4_TAB_MAKES_META |
|
|
678 | if (ev.state & Mod4Mask) |
|
|
679 | meta = 1; |
|
|
680 | #endif |
|
|
681 | newlen = 0; |
|
|
682 | } |
|
|
683 | break; |
|
|
684 | |
|
|
685 | case XK_Up: /* "\033[A" */ |
|
|
686 | case XK_Down: /* "\033[B" */ |
|
|
687 | case XK_Right: /* "\033[C" */ |
|
|
688 | case XK_Left: /* "\033[D" */ |
|
|
689 | strcpy (kbuf, "\033[Z"); |
|
|
690 | kbuf[2] = "DACB"[keysym - XK_Left]; |
|
|
691 | /* do Shift first */ |
|
|
692 | if (shft) |
|
|
693 | kbuf[2] = "dacb"[keysym - XK_Left]; |
|
|
694 | else if (ctrl) |
|
|
695 | { |
|
|
696 | kbuf[1] = 'O'; |
|
|
697 | kbuf[2] = "dacb"[keysym - XK_Left]; |
|
|
698 | } |
|
|
699 | else if (priv_modes & PrivMode_aplCUR) |
|
|
700 | kbuf[1] = 'O'; |
|
|
701 | break; |
|
|
702 | |
|
|
703 | case XK_KP_Enter: |
|
|
704 | /* allow shift to override */ |
|
|
705 | if (kp) |
|
|
706 | { |
|
|
707 | strcpy (kbuf, "\033OM"); |
|
|
708 | break; |
|
|
709 | } |
|
|
710 | |
|
|
711 | /* FALLTHROUGH */ |
|
|
712 | |
|
|
713 | case XK_Return: |
|
|
714 | if (priv_modes & PrivMode_LFNL) |
|
|
715 | { |
|
|
716 | kbuf[0] = '\015'; |
|
|
717 | kbuf[1] = '\012'; |
|
|
718 | kbuf[2] = '\0'; |
|
|
719 | } |
|
|
720 | else |
|
|
721 | { |
|
|
722 | kbuf[0] = '\015'; |
|
|
723 | kbuf[1] = '\0'; |
|
|
724 | } |
|
|
725 | break; |
|
|
726 | |
|
|
727 | case XK_KP_F1: /* "\033OP" */ |
|
|
728 | case XK_KP_F2: /* "\033OQ" */ |
|
|
729 | case XK_KP_F3: /* "\033OR" */ |
|
|
730 | case XK_KP_F4: /* "\033OS" */ |
|
|
731 | strcpy (kbuf, "\033OP"); |
|
|
732 | kbuf[2] += (keysym - XK_KP_F1); |
|
|
733 | break; |
|
|
734 | |
|
|
735 | case XK_KP_Multiply: /* "\033Oj" : "*" */ |
|
|
736 | case XK_KP_Add: /* "\033Ok" : "+" */ |
|
|
737 | case XK_KP_Separator: /* "\033Ol" : "," */ |
|
|
738 | case XK_KP_Subtract: /* "\033Om" : "-" */ |
|
|
739 | case XK_KP_Decimal: /* "\033On" : "." */ |
|
|
740 | case XK_KP_Divide: /* "\033Oo" : "/" */ |
|
|
741 | case XK_KP_0: /* "\033Op" : "0" */ |
|
|
742 | case XK_KP_1: /* "\033Oq" : "1" */ |
|
|
743 | case XK_KP_2: /* "\033Or" : "2" */ |
|
|
744 | case XK_KP_3: /* "\033Os" : "3" */ |
|
|
745 | case XK_KP_4: /* "\033Ot" : "4" */ |
|
|
746 | case XK_KP_5: /* "\033Ou" : "5" */ |
|
|
747 | case XK_KP_6: /* "\033Ov" : "6" */ |
|
|
748 | case XK_KP_7: /* "\033Ow" : "7" */ |
|
|
749 | case XK_KP_8: /* "\033Ox" : "8" */ |
|
|
750 | case XK_KP_9: /* "\033Oy" : "9" */ |
|
|
751 | /* allow shift to override */ |
|
|
752 | if (kp) |
|
|
753 | { |
|
|
754 | strcpy (kbuf, "\033Oj"); |
|
|
755 | kbuf[2] += (keysym - XK_KP_Multiply); |
|
|
756 | } |
|
|
757 | else |
|
|
758 | { |
|
|
759 | kbuf[0] = ('*' + (keysym - XK_KP_Multiply)); |
|
|
760 | kbuf[1] = '\0'; |
|
|
761 | } |
|
|
762 | break; |
|
|
763 | |
|
|
764 | default: |
|
|
765 | { |
|
|
766 | int param = map_function_key (keysym); |
766 | int param = map_function_key (keysym); |
767 | if (param > 0) |
767 | if (param > 0) |
768 | sprintf (kbuf,"\033[%d~", param); |
768 | sprintf (kbuf,"\033[%d~", param); |
769 | else |
769 | else |
770 | newlen = 0; |
770 | newlen = 0; |
771 | } |
|
|
772 | break; |
|
|
773 | } |
771 | } |
|
|
772 | break; |
|
|
773 | } |
774 | |
774 | |
775 | if (newlen) |
775 | if (newlen) |
776 | len = strlen (kbuf); |
776 | len = strlen (kbuf); |
777 | |
777 | |
778 | /* |
778 | /* |
779 | * Pass meta for all function keys, if 'meta' option set |
779 | * Pass meta for all function keys, if 'meta' option set |
780 | */ |
780 | */ |
781 | #ifdef META8_OPTION |
781 | #ifdef META8_OPTION |
… | |
… | |
1015 | } |
1015 | } |
1016 | while (row < end_row); |
1016 | while (row < end_row); |
1017 | } |
1017 | } |
1018 | |
1018 | |
1019 | scr_refresh (); |
1019 | scr_refresh (); |
1020 | scrollbar_show (1); |
1020 | scrollBar.show (1); |
1021 | #ifdef USE_XIM |
1021 | #ifdef USE_XIM |
1022 | IMSendSpot (); |
1022 | IMSendSpot (); |
1023 | #endif |
1023 | #endif |
1024 | } |
1024 | } |
1025 | |
1025 | |
… | |
… | |
1127 | { |
1127 | { |
1128 | // this should really be sched_yield(), but the linux guys thought |
1128 | // this should really be sched_yield(), but the linux guys thought |
1129 | // that giving a process calling sched_yield () less cpu time than |
1129 | // that giving a process calling sched_yield () less cpu time than |
1130 | // ones with high nice levels is a useful thing to do. It surely is is |
1130 | // ones with high nice levels is a useful thing to do. It surely is is |
1131 | // allowed by the sus... as is returning ENOSYS. |
1131 | // allowed by the sus... as is returning ENOSYS. |
|
|
1132 | // since the linux guys additionally thought that breaking the only |
|
|
1133 | // known workaroudn against their unusable sched_yield hack is cool, |
|
|
1134 | // we just nanosleep a bit and hope for the best. |
1132 | |
1135 | |
1133 | struct timespec ts = { 0, 0 }; |
1136 | struct timespec ts = { 0, 1000 }; |
1134 | nanosleep (&ts, 0); |
1137 | nanosleep (&ts, 0); |
1135 | |
1138 | |
1136 | w.stop (); |
1139 | w.stop (); |
1137 | } |
1140 | } |
1138 | |
1141 | |
… | |
… | |
1188 | { |
1191 | { |
1189 | make_current (); |
1192 | make_current (); |
1190 | |
1193 | |
1191 | if (revents & ev::READ) |
1194 | if (revents & ev::READ) |
1192 | // loop, but don't allow a single term to monopolize us |
1195 | // loop, but don't allow a single term to monopolize us |
1193 | while (pty_fill ()) |
1196 | for (int i = CBUFCNT; i-- && pty_fill (); ) |
1194 | if (cmd_parse ()) |
1197 | cmd_parse (); |
1195 | break; |
|
|
1196 | |
1198 | |
1197 | if (revents & ev::WRITE) |
1199 | if (revents & ev::WRITE) |
1198 | pty_write (); |
1200 | pty_write (); |
1199 | |
1201 | |
1200 | refresh_check (); |
1202 | refresh_check (); |
… | |
… | |
1536 | ; |
1538 | ; |
1537 | |
1539 | |
1538 | if (scrollBar.state && ev.xany.window == scrollBar.win) |
1540 | if (scrollBar.state && ev.xany.window == scrollBar.win) |
1539 | { |
1541 | { |
1540 | scrollBar.state = STATE_IDLE; |
1542 | scrollBar.state = STATE_IDLE; |
1541 | scrollbar_show (0); |
1543 | scrollBar.show (0); |
1542 | } |
1544 | } |
1543 | } |
1545 | } |
1544 | break; |
1546 | break; |
1545 | |
1547 | |
1546 | case MotionNotify: |
1548 | case MotionNotify: |
… | |
… | |
1645 | &unused_root, &unused_child, |
1647 | &unused_root, &unused_child, |
1646 | &unused_root_x, &unused_root_y, |
1648 | &unused_root_x, &unused_root_y, |
1647 | &ev.xbutton.x, &ev.xbutton.y, |
1649 | &ev.xbutton.x, &ev.xbutton.y, |
1648 | &unused_mask); |
1650 | &unused_mask); |
1649 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1651 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1650 | scrollbar_size ()); |
1652 | scrollBar.size ()); |
1651 | want_refresh = 1; |
1653 | want_refresh = 1; |
1652 | scrollbar_show (1); |
1654 | scrollBar.show (1); |
1653 | } |
1655 | } |
1654 | break; |
1656 | break; |
1655 | } |
1657 | } |
1656 | |
1658 | |
1657 | #if defined(CURSOR_BLINK) |
1659 | #if defined(CURSOR_BLINK) |
… | |
… | |
1683 | |
1685 | |
1684 | refresh_check (); |
1686 | refresh_check (); |
1685 | } |
1687 | } |
1686 | |
1688 | |
1687 | void |
1689 | void |
|
|
1690 | rxvt_term::set_urgency (bool enable) |
|
|
1691 | { |
|
|
1692 | if (enable == urgency_hint) |
|
|
1693 | return; |
|
|
1694 | |
|
|
1695 | if (XWMHints *h = XGetWMHints (dpy, parent[0])) |
|
|
1696 | { |
|
|
1697 | h->flags = h->flags & ~XUrgencyHint | (enable ? XUrgencyHint : 0); |
|
|
1698 | XSetWMHints (dpy, parent[0], h); |
|
|
1699 | urgency_hint = enable; |
|
|
1700 | } |
|
|
1701 | } |
|
|
1702 | |
|
|
1703 | void |
1688 | rxvt_term::focus_in () |
1704 | rxvt_term::focus_in () |
1689 | { |
1705 | { |
1690 | if (!focus) |
1706 | if (!focus) |
1691 | { |
1707 | { |
1692 | focus = 1; |
1708 | focus = 1; |
1693 | want_refresh = 1; |
1709 | want_refresh = 1; |
1694 | |
|
|
1695 | HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); |
|
|
1696 | |
1710 | |
1697 | #if USE_XIM |
1711 | #if USE_XIM |
1698 | if (Input_Context != NULL) |
1712 | if (Input_Context != NULL) |
1699 | { |
1713 | { |
1700 | IMSetPosition (); |
1714 | IMSetPosition (); |
… | |
… | |
1712 | scr_recolour (); |
1726 | scr_recolour (); |
1713 | } |
1727 | } |
1714 | #endif |
1728 | #endif |
1715 | #if ENABLE_FRILLS |
1729 | #if ENABLE_FRILLS |
1716 | if (option (Opt_urgentOnBell)) |
1730 | if (option (Opt_urgentOnBell)) |
1717 | { |
1731 | set_urgency (0); |
1718 | if (XWMHints *h = XGetWMHints(dpy, parent[0])) |
|
|
1719 | { |
|
|
1720 | h->flags &= ~XUrgencyHint; |
|
|
1721 | XSetWMHints (dpy, parent[0], h); |
|
|
1722 | } |
|
|
1723 | } |
|
|
1724 | #endif |
1732 | #endif |
|
|
1733 | |
|
|
1734 | HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); |
1725 | } |
1735 | } |
1726 | } |
1736 | } |
1727 | |
1737 | |
1728 | void |
1738 | void |
1729 | rxvt_term::focus_out () |
1739 | rxvt_term::focus_out () |
… | |
… | |
1731 | if (focus) |
1741 | if (focus) |
1732 | { |
1742 | { |
1733 | focus = 0; |
1743 | focus = 0; |
1734 | want_refresh = 1; |
1744 | want_refresh = 1; |
1735 | |
1745 | |
1736 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1746 | #if ENABLE_FRILLS |
1737 | |
1747 | if (option (Opt_urgentOnBell)) |
|
|
1748 | set_urgency (0); |
|
|
1749 | #endif |
1738 | #if ENABLE_FRILLS || ISO_14755 |
1750 | #if ENABLE_FRILLS || ISO_14755 |
1739 | if (iso14755buf) |
1751 | if (iso14755buf) |
1740 | { |
1752 | { |
1741 | iso14755buf = 0; |
1753 | iso14755buf = 0; |
1742 | # if ISO_14755 |
1754 | # if ISO_14755 |
… | |
… | |
1759 | { |
1771 | { |
1760 | pix_colors = pix_colors_unfocused; |
1772 | pix_colors = pix_colors_unfocused; |
1761 | scr_recolour (); |
1773 | scr_recolour (); |
1762 | } |
1774 | } |
1763 | #endif |
1775 | #endif |
|
|
1776 | |
|
|
1777 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1764 | } |
1778 | } |
1765 | } |
1779 | } |
1766 | |
1780 | |
1767 | void |
1781 | void |
1768 | rxvt_term::update_fade_color (unsigned int idx) |
1782 | rxvt_term::update_fade_color (unsigned int idx) |
… | |
… | |
2010 | } |
2024 | } |
2011 | |
2025 | |
2012 | if (scrollBar.style == R_SB_XTERM |
2026 | if (scrollBar.style == R_SB_XTERM |
2013 | || scrollbar_above_slider (ev.y) |
2027 | || scrollbar_above_slider (ev.y) |
2014 | || scrollbar_below_slider (ev.y)) |
2028 | || scrollbar_below_slider (ev.y)) |
2015 | scr_move_to (scrollbar_position (ev.y) - csrO, scrollbar_size ()); |
2029 | scr_move_to (scrollbar_position (ev.y) - csrO, scrollBar.size ()); |
2016 | |
2030 | |
2017 | scrollBar.state = STATE_MOTION; |
2031 | scrollBar.state = STATE_MOTION; |
2018 | break; |
2032 | break; |
2019 | |
2033 | |
2020 | case Button1: |
2034 | case Button1: |
… | |
… | |
2043 | else |
2057 | else |
2044 | { |
2058 | { |
2045 | scr_page ((ev.button == Button1 ? DN : UP), |
2059 | scr_page ((ev.button == Button1 ? DN : UP), |
2046 | (nrow |
2060 | (nrow |
2047 | * scrollbar_position (ev.y) |
2061 | * scrollbar_position (ev.y) |
2048 | / scrollbar_size ())); |
2062 | / scrollBar.size ())); |
2049 | } |
2063 | } |
2050 | |
2064 | |
2051 | break; |
2065 | break; |
2052 | } |
2066 | } |
2053 | } |
2067 | } |
… | |
… | |
2066 | reportmode = !! (priv_modes & PrivMode_mouse_report); |
2080 | reportmode = !! (priv_modes & PrivMode_mouse_report); |
2067 | |
2081 | |
2068 | if (scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN) |
2082 | if (scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN) |
2069 | { |
2083 | { |
2070 | scrollBar.state = STATE_IDLE; |
2084 | scrollBar.state = STATE_IDLE; |
2071 | scrollbar_show (0); |
2085 | scrollBar.show (0); |
2072 | } |
2086 | } |
2073 | |
2087 | |
2074 | #ifdef SELECTION_SCROLLING |
2088 | #ifdef SELECTION_SCROLLING |
2075 | sel_scroll_ev.stop(); |
2089 | sel_scroll_ev.stop(); |
2076 | #endif |
2090 | #endif |
… | |
… | |
2159 | } |
2173 | } |
2160 | else |
2174 | else |
2161 | # endif |
2175 | # endif |
2162 | { |
2176 | { |
2163 | scr_page (v, i); |
2177 | scr_page (v, i); |
2164 | scrollbar_show (1); |
2178 | scrollBar.show (1); |
2165 | } |
2179 | } |
2166 | } |
2180 | } |
2167 | break; |
2181 | break; |
2168 | #endif |
2182 | #endif |
2169 | } |
2183 | } |
2170 | } |
2184 | } |
2171 | } |
2185 | } |
2172 | |
2186 | |
2173 | /*}}} */ |
2187 | /*}}} */ |
2174 | |
2188 | |
2175 | bool |
2189 | void |
2176 | rxvt_term::cmd_parse () |
2190 | rxvt_term::cmd_parse () |
2177 | { |
2191 | { |
2178 | bool flag = false; |
|
|
2179 | wchar_t ch = NOCHAR; |
2192 | wchar_t ch = NOCHAR; |
2180 | char *seq_begin; // remember start of esc-sequence here |
2193 | char *seq_begin; // remember start of esc-sequence here |
2181 | |
2194 | |
2182 | for (;;) |
2195 | for (;;) |
2183 | { |
2196 | { |
2184 | if (ch == NOCHAR) |
2197 | if (expect_false (ch == NOCHAR)) |
2185 | { |
2198 | { |
2186 | seq_begin = cmdbuf_ptr; |
2199 | seq_begin = cmdbuf_ptr; |
2187 | ch = next_char (); |
2200 | ch = next_char (); |
2188 | |
2201 | |
2189 | if (ch == NOCHAR) |
2202 | if (ch == NOCHAR) |
2190 | break; |
2203 | break; |
2191 | } |
2204 | } |
2192 | |
2205 | |
2193 | if (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT) |
2206 | if (expect_true (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT)) |
2194 | { |
2207 | { |
2195 | if (!seen_input) |
2208 | if (expect_false (!seen_input)) |
2196 | { |
2209 | { |
2197 | seen_input = 1; |
2210 | seen_input = 1; |
2198 | // many badly-written programs (e.g. jed) contain a race condition: |
2211 | // many badly-written programs (e.g. jed) contain a race condition: |
2199 | // they first read the screensize and then install a SIGWINCH handler. |
2212 | // they first read the screensize and then install a SIGWINCH handler. |
2200 | // some window managers resize the window early, and these programs |
2213 | // some window managers resize the window early, and these programs |
… | |
… | |
2213 | wchar_t *str = buf; |
2226 | wchar_t *str = buf; |
2214 | wchar_t *eol = str + min (ncol, UBUFSIZ); |
2227 | wchar_t *eol = str + min (ncol, UBUFSIZ); |
2215 | |
2228 | |
2216 | for (;;) |
2229 | for (;;) |
2217 | { |
2230 | { |
2218 | if (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT)) |
2231 | if (expect_false (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT))) |
2219 | break; |
2232 | break; |
2220 | |
2233 | |
2221 | *str++ = ch; |
2234 | *str++ = ch; |
2222 | |
2235 | |
2223 | if (ch == C0_LF || str >= eol) |
2236 | if (expect_false (ch == C0_LF || str >= eol)) |
2224 | { |
2237 | { |
2225 | if (ch == C0_LF) |
2238 | if (ch == C0_LF) |
2226 | nlines++; |
2239 | nlines++; |
2227 | |
2240 | |
2228 | refresh_count++; |
2241 | refresh_count++; |
… | |
… | |
2277 | * What the heck we'll cheat and only refresh less than every page-full. |
2290 | * What the heck we'll cheat and only refresh less than every page-full. |
2278 | * if skipScroll is enabled. |
2291 | * if skipScroll is enabled. |
2279 | */ |
2292 | */ |
2280 | if (refreshnow) |
2293 | if (refreshnow) |
2281 | { |
2294 | { |
2282 | flag = true; |
|
|
2283 | scr_refresh (); |
2295 | scr_refresh (); |
2284 | want_refresh = 1; |
2296 | want_refresh = 1; |
2285 | } |
2297 | } |
2286 | |
|
|
2287 | } |
2298 | } |
2288 | else |
2299 | else |
2289 | { |
2300 | { |
2290 | try |
2301 | try |
2291 | { |
2302 | { |
… | |
… | |
2299 | } |
2310 | } |
2300 | |
2311 | |
2301 | ch = NOCHAR; |
2312 | ch = NOCHAR; |
2302 | } |
2313 | } |
2303 | } |
2314 | } |
2304 | |
|
|
2305 | return flag; |
|
|
2306 | } |
2315 | } |
2307 | |
2316 | |
2308 | // read the next character |
2317 | // read the next character |
2309 | wchar_t |
2318 | wchar_t |
2310 | rxvt_term::next_char () NOTHROW |
2319 | rxvt_term::next_char () NOTHROW |
2311 | { |
2320 | { |
2312 | while (cmdbuf_ptr < cmdbuf_endp) |
2321 | while (cmdbuf_ptr < cmdbuf_endp) |
2313 | { |
2322 | { |
2314 | // assume 7-bit to be ascii ALWAYS |
2323 | // assume 7-bit to be ascii ALWAYS |
2315 | if ((unsigned char)*cmdbuf_ptr <= 0x7f && *cmdbuf_ptr != 0x1b) |
2324 | if (expect_true ((unsigned char)*cmdbuf_ptr <= 0x7f && *cmdbuf_ptr != 0x1b)) |
2316 | return *cmdbuf_ptr++; |
2325 | return *cmdbuf_ptr++; |
2317 | |
2326 | |
2318 | wchar_t wc; |
2327 | wchar_t wc; |
2319 | size_t len = mbrtowc (&wc, cmdbuf_ptr, cmdbuf_endp - cmdbuf_ptr, mbstate); |
2328 | size_t len = mbrtowc (&wc, cmdbuf_ptr, cmdbuf_endp - cmdbuf_ptr, mbstate); |
2320 | |
2329 | |
… | |
… | |
2324 | cmdbuf_ptr = cmdbuf_endp; |
2333 | cmdbuf_ptr = cmdbuf_endp; |
2325 | break; |
2334 | break; |
2326 | } |
2335 | } |
2327 | |
2336 | |
2328 | if (len == (size_t)-1) |
2337 | if (len == (size_t)-1) |
|
|
2338 | { |
|
|
2339 | mbrtowc (0, 0, 0, mbstate); // reset now undefined conversion state |
2329 | return (unsigned char)*cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through |
2340 | return (unsigned char)*cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through |
|
|
2341 | } |
2330 | |
2342 | |
2331 | // assume wchar == unicode |
2343 | // assume wchar == unicode |
2332 | cmdbuf_ptr += len; |
2344 | cmdbuf_ptr += len; |
2333 | return wc & UNICODE_MASK; |
2345 | return wc & UNICODE_MASK; |
2334 | } |
2346 | } |
… | |
… | |
2378 | /*----------------------------------------------------------------------*/ |
2390 | /*----------------------------------------------------------------------*/ |
2379 | #ifdef PRINTPIPE |
2391 | #ifdef PRINTPIPE |
2380 | FILE * |
2392 | FILE * |
2381 | rxvt_term::popen_printer () |
2393 | rxvt_term::popen_printer () |
2382 | { |
2394 | { |
2383 | FILE *stream = popen (rs[Rs_print_pipe], "w"); |
2395 | FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w"); |
2384 | |
2396 | |
2385 | if (stream == NULL) |
2397 | if (stream == NULL) |
2386 | rxvt_warn ("can't open printer pipe, not printing.\n"); |
2398 | rxvt_warn ("can't open printer pipe, not printing.\n"); |
2387 | |
2399 | |
2388 | return stream; |
2400 | return stream; |
… | |
… | |
2399 | * simulate attached vt100 printer |
2411 | * simulate attached vt100 printer |
2400 | */ |
2412 | */ |
2401 | void |
2413 | void |
2402 | rxvt_term::process_print_pipe () |
2414 | rxvt_term::process_print_pipe () |
2403 | { |
2415 | { |
2404 | int done; |
2416 | FILE *fd = popen_printer (); |
2405 | FILE *fd; |
|
|
2406 | |
2417 | |
2407 | if ((fd = popen_printer ()) == NULL) |
2418 | if (!fd) |
2408 | return; |
2419 | return; |
2409 | |
2420 | |
2410 | /* |
2421 | /* |
2411 | * Send all input to the printer until either ESC[4i or ESC[?4i |
2422 | * Send all input to the printer until either ESC[4i or ESC[?4i |
2412 | * is received. |
2423 | * is received. |
2413 | */ |
2424 | */ |
2414 | for (done = 0; !done;) |
2425 | for (int done = 0; !done; ) |
2415 | { |
2426 | { |
2416 | unsigned char buf[8]; |
2427 | unsigned char buf[8]; |
2417 | unicode_t ch; |
2428 | unicode_t ch; |
2418 | unsigned int i, len; |
2429 | unsigned int i, len; |
2419 | |
2430 | |
… | |
… | |
2564 | break; |
2575 | break; |
2565 | case 'Z': /* identify the terminal type */ |
2576 | case 'Z': /* identify the terminal type */ |
2566 | tt_printf ("\033/Z"); /* I am a VT100 emulating a VT52 */ |
2577 | tt_printf ("\033/Z"); /* I am a VT100 emulating a VT52 */ |
2567 | break; |
2578 | break; |
2568 | case '<': /* turn off VT52 mode */ |
2579 | case '<': /* turn off VT52 mode */ |
2569 | PrivMode (0, PrivMode_vt52); |
2580 | set_privmode (PrivMode_vt52, 0); |
2570 | break; |
2581 | break; |
2571 | case 'F': /* use special graphics character set */ |
2582 | case 'F': /* use special graphics character set */ |
2572 | case 'G': /* use regular character set */ |
2583 | case 'G': /* use regular character set */ |
2573 | /* unimplemented */ |
2584 | /* unimplemented */ |
2574 | break; |
2585 | break; |
… | |
… | |
2628 | scr_forwardindex (); |
2639 | scr_forwardindex (); |
2629 | break; |
2640 | break; |
2630 | #endif |
2641 | #endif |
2631 | case '=': |
2642 | case '=': |
2632 | case '>': |
2643 | case '>': |
2633 | PrivMode ((ch == '='), PrivMode_aplKP); |
2644 | set_privmode (PrivMode_aplKP, ch == '='); |
2634 | break; |
2645 | break; |
2635 | |
2646 | |
2636 | case C1_40: |
2647 | case C1_40: |
2637 | cmd_getc (); |
2648 | cmd_getc (); |
2638 | break; |
2649 | break; |
… | |
… | |
2677 | /* 8.3.110: SINGLE CHARACTER INTRODUCER */ |
2688 | /* 8.3.110: SINGLE CHARACTER INTRODUCER */ |
2678 | case C1_SCI: /* ESC Z */ |
2689 | case C1_SCI: /* ESC Z */ |
2679 | tt_write (ESCZ_ANSWER, sizeof (ESCZ_ANSWER) - 1); |
2690 | tt_write (ESCZ_ANSWER, sizeof (ESCZ_ANSWER) - 1); |
2680 | break; /* steal obsolete ESC [ c */ |
2691 | break; /* steal obsolete ESC [ c */ |
2681 | |
2692 | |
2682 | /* 8.3.16: CONTROL SEQUENCE INTRODUCER */ |
2693 | /* 8.3.16: CONTROL SEQUENCE INTRODUCER (CSI) */ |
2683 | case C1_CSI: /* ESC [ */ |
2694 | case C1_CSI: /* ESC [ */ |
2684 | process_csi_seq (); |
2695 | process_csi_seq (); |
2685 | break; |
2696 | break; |
2686 | |
2697 | |
2687 | /* 8.3.90: OPERATING SYSTEM COMMAND */ |
2698 | /* 8.3.90: OPERATING SYSTEM COMMAND (OSC) */ |
2688 | case C1_OSC: /* ESC ] */ |
2699 | case C1_OSC: /* ESC ] */ |
2689 | process_osc_seq (); |
2700 | process_osc_seq (); |
2690 | break; |
2701 | break; |
2691 | |
2702 | |
2692 | /* 8.3.106: RESET TO INITIAL STATE */ |
2703 | /* 8.3.106: RESET TO INITIAL STATE (RIS) */ |
2693 | case 'c': |
2704 | case 'c': |
2694 | mbstate.reset (); |
2705 | mbstate.reset (); |
2695 | scr_poweron (); |
2706 | scr_poweron (); |
2696 | scrollbar_show (1); |
2707 | scrollBar.show (1); |
2697 | break; |
2708 | break; |
2698 | |
2709 | |
2699 | /* 8.3.79: LOCKING-SHIFT TWO (see ISO2022) */ |
2710 | /* 8.3.79: LOCKING-SHIFT TWO (see ISO2022) */ |
2700 | case 'n': |
2711 | case 'n': |
2701 | scr_charset_choose (2); |
2712 | scr_charset_choose (2); |
… | |
… | |
2752 | |
2763 | |
2753 | nargs = 0; |
2764 | nargs = 0; |
2754 | |
2765 | |
2755 | priv = 0; |
2766 | priv = 0; |
2756 | ch = cmd_getc (); |
2767 | ch = cmd_getc (); |
2757 | if (ch >= '<' && ch <= '?') |
2768 | if ((ch >= '<' && ch <= '?') || ch == '!') |
2758 | { |
2769 | { |
2759 | /* '<' '=' '>' '?' */ |
2770 | /* '<' '=' '>' '?' '!' */ |
2760 | priv = ch; |
2771 | priv = ch; |
2761 | ch = cmd_getc (); |
2772 | ch = cmd_getc (); |
2762 | } |
2773 | } |
2763 | |
2774 | |
2764 | /* read any numerical arguments */ |
2775 | /* read any numerical arguments */ |
… | |
… | |
2818 | |
2829 | |
2819 | case '?': |
2830 | case '?': |
2820 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
2831 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
2821 | process_terminal_mode (ch, priv, nargs, arg); |
2832 | process_terminal_mode (ch, priv, nargs, arg); |
2822 | break; |
2833 | break; |
|
|
2834 | |
|
|
2835 | case '!': |
|
|
2836 | if (ch == CSI_70) |
|
|
2837 | { |
|
|
2838 | /* DECSTR: soft terminal reset, used by our terminfo since 9.06 */ |
|
|
2839 | scr_soft_reset (); |
|
|
2840 | |
|
|
2841 | static const int pm_h[] = { 7, 25 }; |
|
|
2842 | static const int pm_l[] = { 1, 3, 4, 5, 6, 9, 66, 1000, 1001, 1049 }; |
|
|
2843 | |
|
|
2844 | process_terminal_mode ('h', 0, sizeof (pm_h) / sizeof (pm_h[0]), pm_h); |
|
|
2845 | process_terminal_mode ('l', 0, sizeof (pm_l) / sizeof (pm_l[0]), pm_l); |
2823 | } |
2846 | } |
|
|
2847 | break; |
|
|
2848 | } |
|
|
2849 | |
2824 | return; |
2850 | return; |
2825 | } |
2851 | } |
2826 | |
2852 | |
2827 | switch (ch) |
2853 | switch (ch) |
2828 | { |
2854 | { |
… | |
… | |
3374 | break; |
3400 | break; |
3375 | case URxvt_Color_IT: |
3401 | case URxvt_Color_IT: |
3376 | process_color_seq (op, Color_IT, str, resp); |
3402 | process_color_seq (op, Color_IT, str, resp); |
3377 | break; |
3403 | break; |
3378 | #endif |
3404 | #endif |
|
|
3405 | case URxvt_Color_border: |
|
|
3406 | process_color_seq (op, Color_border, str, resp); |
|
|
3407 | break; |
3379 | #if ENABLE_TRANSPARENCY |
3408 | #if ENABLE_TRANSPARENCY |
3380 | case URxvt_Color_tint: |
3409 | case URxvt_Color_tint: |
3381 | process_color_seq (op, Color_tint, str, resp); |
3410 | process_color_seq (op, Color_tint, str, resp); |
3382 | { |
3411 | { |
3383 | bool changed = false; |
3412 | bool changed = false; |
… | |
… | |
3507 | break; |
3536 | break; |
3508 | #endif |
3537 | #endif |
3509 | |
3538 | |
3510 | #if ENABLE_PERL |
3539 | #if ENABLE_PERL |
3511 | case URxvt_perl: |
3540 | case URxvt_perl: |
3512 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_END))) |
3541 | HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_STR_LEN, &resp, 1, DT_END)); |
3513 | ; // no responses yet |
|
|
3514 | break; |
3542 | break; |
3515 | #endif |
3543 | #endif |
3516 | } |
3544 | } |
3517 | } |
3545 | } |
3518 | /*----------------------------------------------------------------------*/ |
3546 | /*----------------------------------------------------------------------*/ |
… | |
… | |
3541 | { |
3569 | { |
3542 | if (mode == 'r') |
3570 | if (mode == 'r') |
3543 | state = (SavedModes & bit) ? 1 : 0; /* no overlapping */ |
3571 | state = (SavedModes & bit) ? 1 : 0; /* no overlapping */ |
3544 | else |
3572 | else |
3545 | state = (mode == 't') ? ! (priv_modes & bit) : mode; |
3573 | state = (mode == 't') ? ! (priv_modes & bit) : mode; |
3546 | PrivMode (state, bit); |
3574 | set_privmode (bit, state); |
3547 | } |
3575 | } |
3548 | |
3576 | |
3549 | return state; |
3577 | return state; |
3550 | } |
3578 | } |
3551 | |
3579 | |
… | |
… | |
3559 | static const struct |
3587 | static const struct |
3560 | { |
3588 | { |
3561 | const int argval; |
3589 | const int argval; |
3562 | const unsigned long bit; |
3590 | const unsigned long bit; |
3563 | } argtopriv[] = { |
3591 | } argtopriv[] = { |
3564 | { 1, PrivMode_aplCUR }, |
3592 | { 1, PrivMode_aplCUR }, // DECCKM |
3565 | { 2, PrivMode_vt52 }, |
3593 | { 2, PrivMode_vt52 }, |
3566 | { 3, PrivMode_132 }, |
3594 | { 3, PrivMode_132 }, // DECCOLM |
3567 | { 4, PrivMode_smoothScroll }, |
3595 | { 4, PrivMode_smoothScroll }, // DECSCLM |
3568 | { 5, PrivMode_rVideo }, |
3596 | { 5, PrivMode_rVideo }, // DECSCNM |
3569 | { 6, PrivMode_relOrigin }, |
3597 | { 6, PrivMode_relOrigin }, // DECOM |
3570 | { 7, PrivMode_Autowrap }, |
3598 | { 7, PrivMode_Autowrap }, // DECAWM |
3571 | // 8, bi-directional support mode |
3599 | // 8, auto-repeat keys // DECARM |
3572 | { 9, PrivMode_MouseX10 }, |
3600 | { 9, PrivMode_MouseX10 }, |
3573 | // 18, 19 printing-related |
3601 | // 18 end FF to printer after print screen |
|
|
3602 | // 19 Print screen prints full screen/scorll region |
3574 | { 25, PrivMode_VisibleCursor }, |
3603 | { 25, PrivMode_VisibleCursor }, // cnorm/cvvis/civis |
3575 | #ifdef scrollBar_esc |
3604 | #ifdef scrollBar_esc |
3576 | { scrollBar_esc, PrivMode_scrollBar }, |
3605 | { scrollBar_esc, PrivMode_scrollBar }, |
3577 | #endif |
3606 | #endif |
3578 | { 35, PrivMode_ShiftKeys }, // rxvt extension |
3607 | { 35, PrivMode_ShiftKeys }, // rxvt extension |
|
|
3608 | // 38, tektronix mode // DECTEK |
3579 | { 40, PrivMode_132OK }, |
3609 | { 40, PrivMode_132OK }, |
3580 | // 41 xterm more fixes NYI |
3610 | // 41 xterm more fixes NYI |
3581 | // 45 margin bell NYI |
3611 | // 45 margin bell NYI |
3582 | // 46 start logging |
3612 | // 46 start logging |
3583 | { 47, PrivMode_Screen }, |
3613 | { 47, PrivMode_Screen }, |
3584 | { 66, PrivMode_aplKP }, |
3614 | { 66, PrivMode_aplKP }, // DECPAM/DECPNM |
3585 | #ifndef NO_BACKSPACE_KEY |
3615 | #ifndef NO_BACKSPACE_KEY |
3586 | { 67, PrivMode_BackSpace }, |
3616 | { 67, PrivMode_BackSpace }, // DECBKM |
3587 | #endif |
3617 | #endif |
3588 | { 1000, PrivMode_MouseX11 }, |
3618 | { 1000, PrivMode_MouseX11 }, |
3589 | { 1002, PrivMode_MouseBtnEvent }, |
3619 | { 1002, PrivMode_MouseBtnEvent }, |
3590 | { 1003, PrivMode_MouseAnyEvent }, |
3620 | { 1003, PrivMode_MouseAnyEvent }, |
3591 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3621 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
… | |
… | |
3630 | |
3660 | |
3631 | scr_touch (true); |
3661 | scr_touch (true); |
3632 | break; |
3662 | break; |
3633 | #endif |
3663 | #endif |
3634 | case 1048: /* alternative cursor save */ |
3664 | case 1048: /* alternative cursor save */ |
3635 | case 1049: |
|
|
3636 | if (option (Opt_secondaryScreen)) |
3665 | if (option (Opt_secondaryScreen)) |
3637 | if (mode == 0) |
3666 | if (mode == 0) |
3638 | scr_cursor (RESTORE); |
3667 | scr_cursor (RESTORE); |
3639 | else if (mode == 1) |
3668 | else if (mode == 1) |
3640 | scr_cursor (SAVE); |
3669 | scr_cursor (SAVE); |
… | |
… | |
3649 | case 2: /* VT52 mode */ |
3678 | case 2: /* VT52 mode */ |
3650 | /* oddball mode. should be set regardless of set/reset |
3679 | /* oddball mode. should be set regardless of set/reset |
3651 | * parameter. Return from VT52 mode with an ESC < from |
3680 | * parameter. Return from VT52 mode with an ESC < from |
3652 | * within VT52 mode |
3681 | * within VT52 mode |
3653 | */ |
3682 | */ |
3654 | PrivMode (1, PrivMode_vt52); |
3683 | set_privmode (PrivMode_vt52, 1); |
3655 | break; |
3684 | break; |
3656 | case 3: /* 80/132 */ |
3685 | case 3: /* 80/132 */ |
3657 | if (priv_modes & PrivMode_132OK) |
3686 | if (priv_modes & PrivMode_132OK) |
3658 | { |
|
|
3659 | scr_poweron (); |
|
|
3660 | set_widthheight (((state ? 132 : 80) * fwidth), 24 * fheight); |
3687 | set_widthheight ((state ? 132 : 80) * fwidth, 24 * fheight); |
3661 | } |
|
|
3662 | break; |
3688 | break; |
3663 | case 4: /* smooth scrolling */ |
3689 | case 4: /* smooth scrolling */ |
3664 | set_option (Opt_jumpScroll, !state); |
3690 | set_option (Opt_jumpScroll, !state); |
3665 | break; |
3691 | break; |
3666 | case 5: /* reverse video */ |
3692 | case 5: /* reverse video */ |
… | |
… | |
3677 | if (state) /* orthogonal */ |
3703 | if (state) /* orthogonal */ |
3678 | priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); |
3704 | priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); |
3679 | break; |
3705 | break; |
3680 | #ifdef scrollBar_esc |
3706 | #ifdef scrollBar_esc |
3681 | case scrollBar_esc: |
3707 | case scrollBar_esc: |
3682 | if (scrollbar_mapping (state)) |
3708 | if (scrollBar.map (state)) |
3683 | { |
3709 | { |
3684 | resize_all_windows (0, 0, 0); |
3710 | resize_all_windows (0, 0, 0); |
3685 | scr_touch (true); |
3711 | scr_touch (true); |
3686 | } |
3712 | } |
3687 | break; |
3713 | break; |
… | |
… | |
3708 | priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent; |
3734 | priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent; |
3709 | vt_emask_mouse = PointerMotionMask; |
3735 | vt_emask_mouse = PointerMotionMask; |
3710 | } |
3736 | } |
3711 | else |
3737 | else |
3712 | vt_emask_mouse = NoEventMask; |
3738 | vt_emask_mouse = NoEventMask; |
|
|
3739 | |
3713 | vt_select_input (); |
3740 | vt_select_input (); |
3714 | break; |
3741 | break; |
3715 | case 1010: /* scroll to bottom on TTY output inhibit */ |
3742 | case 1010: /* scroll to bottom on TTY output inhibit */ |
3716 | set_option (Opt_scrollTtyOutput, !state); |
3743 | set_option (Opt_scrollTtyOutput, !state); |
3717 | break; |
3744 | break; |
3718 | case 1011: /* scroll to bottom on key press */ |
3745 | case 1011: /* scroll to bottom on key press */ |
3719 | set_option (Opt_scrollTtyKeypress, state); |
3746 | set_option (Opt_scrollTtyKeypress, state); |
3720 | break; |
3747 | break; |
3721 | case 1047: /* secondary screen w/ clearing last */ |
3748 | case 1047: /* secondary screen w/ clearing last */ |
3722 | if (option (Opt_secondaryScreen)) |
3749 | if (option (Opt_secondaryScreen)) |
3723 | if (current_screen != PRIMARY) |
3750 | if (!state) |
3724 | scr_erase_screen (2); |
3751 | scr_erase_screen (2); |
|
|
3752 | |
3725 | scr_change_screen (state); |
3753 | scr_change_screen (state); |
3726 | break; |
3754 | break; |
3727 | case 1049: /* secondary screen w/ clearing first */ |
3755 | case 1049: /* secondary screen w/ clearing first */ |
|
|
3756 | if (state) |
|
|
3757 | scr_cursor (SAVE); |
|
|
3758 | |
3728 | scr_change_screen (state); |
3759 | scr_change_screen (state); |
3729 | if (option (Opt_secondaryScreen)) |
3760 | |
3730 | if (current_screen != PRIMARY) |
3761 | if (state) |
3731 | scr_erase_screen (2); |
3762 | scr_erase_screen (2); |
|
|
3763 | else |
|
|
3764 | scr_cursor (RESTORE); |
3732 | break; |
3765 | break; |
3733 | default: |
3766 | default: |
3734 | break; |
3767 | break; |
3735 | } |
3768 | } |
3736 | } |
3769 | } |