… | |
… | |
49 | #include "rxvt.h" /* NECESSARY */ |
49 | #include "rxvt.h" /* NECESSARY */ |
50 | #include "version.h" |
50 | #include "version.h" |
51 | #include "command.h" |
51 | #include "command.h" |
52 | |
52 | |
53 | #include <wchar.h> |
53 | #include <wchar.h> |
|
|
54 | #include <signal.h> |
54 | |
55 | |
55 | /*----------------------------------------------------------------------*/ |
56 | /*----------------------------------------------------------------------*/ |
56 | |
57 | |
57 | #define IS_CONTROL(ch) !((ch) & 0xffffff60UL) |
58 | #define IS_CONTROL(ch) !((ch) & 0xffffff60UL) |
58 | |
59 | |
… | |
… | |
417 | { |
418 | { |
418 | /* normal XTerm key bindings */ |
419 | /* normal XTerm key bindings */ |
419 | case XK_Insert: /* Shift+Insert = paste mouse selection */ |
420 | case XK_Insert: /* Shift+Insert = paste mouse selection */ |
420 | selection_request (ev.time, 0, 0); |
421 | selection_request (ev.time, 0, 0); |
421 | return; |
422 | return; |
422 | #if TODO // TODO |
423 | #if TODO |
423 | /* rxvt extras */ |
424 | /* rxvt extras */ |
424 | case XK_KP_Add: /* Shift+KP_Add = bigger font */ |
425 | case XK_KP_Add: /* Shift+KP_Add = bigger font */ |
425 | change_font (FONT_UP); |
426 | change_font (FONT_UP); |
426 | return; |
427 | return; |
427 | case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ |
428 | case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ |
… | |
… | |
910 | #endif /* MENUBAR_MAX */ |
911 | #endif /* MENUBAR_MAX */ |
911 | |
912 | |
912 | void |
913 | void |
913 | rxvt_term::flush () |
914 | rxvt_term::flush () |
914 | { |
915 | { |
|
|
916 | flush_ev.stop (); |
|
|
917 | |
915 | #ifdef TRANSPARENT |
918 | #ifdef TRANSPARENT |
916 | if (want_full_refresh) |
919 | if (want_full_refresh) |
917 | { |
920 | { |
918 | want_full_refresh = 0; |
921 | want_full_refresh = 0; |
919 | scr_clear (); |
922 | scr_clear (); |
… | |
… | |
929 | IMSendSpot (); |
932 | IMSendSpot (); |
930 | #endif |
933 | #endif |
931 | } |
934 | } |
932 | |
935 | |
933 | display->flush (); |
936 | display->flush (); |
934 | |
|
|
935 | flush_ev.stop (); |
|
|
936 | } |
937 | } |
937 | |
938 | |
938 | void |
939 | void |
939 | rxvt_term::check_cb (check_watcher &w) |
940 | rxvt_term::check_cb (check_watcher &w) |
940 | { |
941 | { |
… | |
… | |
1214 | pointer_unblank (); |
1215 | pointer_unblank (); |
1215 | |
1216 | |
1216 | if (ev.type == KeyPress && hidden_pointer == 0) |
1217 | if (ev.type == KeyPress && hidden_pointer == 0) |
1217 | pointer_blank (); |
1218 | pointer_blank (); |
1218 | } |
1219 | } |
1219 | #endif |
|
|
1220 | |
|
|
1221 | #ifdef USE_XIM |
|
|
1222 | if (XFilterEvent (&ev, None)) |
|
|
1223 | return; |
|
|
1224 | #endif |
1220 | #endif |
1225 | |
1221 | |
1226 | Window unused_root, unused_child; |
1222 | Window unused_root, unused_child; |
1227 | int unused_root_x, unused_root_y; |
1223 | int unused_root_x, unused_root_y; |
1228 | unsigned int unused_mask; |
1224 | unsigned int unused_mask; |
… | |
… | |
1562 | { |
1558 | { |
1563 | menubar_control (ev.xbutton); |
1559 | menubar_control (ev.xbutton); |
1564 | break; |
1560 | break; |
1565 | } |
1561 | } |
1566 | #endif |
1562 | #endif |
1567 | if ((priv_modes & PrivMode_mouse_report) && ! (bypass_keystate)) |
1563 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1568 | break; |
1564 | break; |
1569 | |
1565 | |
1570 | if (ev.xany.window == TermWin.vt) |
1566 | if (ev.xany.window == TermWin.vt) |
1571 | { |
1567 | { |
1572 | if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
1568 | if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
… | |
… | |
1575 | ; |
1571 | ; |
1576 | |
1572 | |
1577 | XQueryPointer (display->display, TermWin.vt, |
1573 | XQueryPointer (display->display, TermWin.vt, |
1578 | &unused_root, &unused_child, |
1574 | &unused_root, &unused_child, |
1579 | &unused_root_x, &unused_root_y, |
1575 | &unused_root_x, &unused_root_y, |
1580 | & (ev.xbutton.x), & (ev.xbutton.y), |
1576 | &ev.xbutton.x, &ev.xbutton.y, |
1581 | &unused_mask); |
1577 | &ev.xbutton.state); |
1582 | #ifdef MOUSE_THRESHOLD |
1578 | #ifdef MOUSE_THRESHOLD |
1583 | /* deal with a `jumpy' mouse */ |
1579 | /* deal with a `jumpy' mouse */ |
1584 | if ((ev.xmotion.time - MEvent.time) > MOUSE_THRESHOLD) |
1580 | if ((ev.xmotion.time - MEvent.time) > MOUSE_THRESHOLD) |
1585 | { |
1581 | { |
1586 | #endif |
1582 | #endif |
… | |
… | |
1591 | iso14755_54 (ev.xbutton.x, ev.xbutton.y); |
1587 | iso14755_54 (ev.xbutton.x, ev.xbutton.y); |
1592 | break; |
1588 | break; |
1593 | } |
1589 | } |
1594 | #endif |
1590 | #endif |
1595 | selection_extend (ev.xbutton.x, ev.xbutton.y, |
1591 | selection_extend (ev.xbutton.x, ev.xbutton.y, |
1596 | (ev.xbutton.state & Button3Mask) ? 2 : 0); |
1592 | ev.xbutton.state & Button3Mask ? 2 : 0); |
|
|
1593 | |
1597 | #ifdef SELECTION_SCROLLING |
1594 | #ifdef SELECTION_SCROLLING |
1598 | if (ev.xbutton.y < TermWin.int_bwidth |
1595 | if (ev.xbutton.y < TermWin.int_bwidth |
1599 | || Pixel2Row (ev.xbutton.y) > (TermWin.nrow-1)) |
1596 | || Pixel2Row (ev.xbutton.y) > (TermWin.nrow-1)) |
1600 | { |
1597 | { |
1601 | int dist; |
1598 | int dist; |
… | |
… | |
1612 | selection_save_x = ev.xbutton.x; |
1609 | selection_save_x = ev.xbutton.x; |
1613 | selection_save_y = ev.xbutton.y; |
1610 | selection_save_y = ev.xbutton.y; |
1614 | selection_save_state = (ev.xbutton.state & Button3Mask) ? 2 : 0; |
1611 | selection_save_state = (ev.xbutton.state & Button3Mask) ? 2 : 0; |
1615 | |
1612 | |
1616 | /* calc number of lines to scroll */ |
1613 | /* calc number of lines to scroll */ |
1617 | if (ev.xbutton.y<TermWin.int_bwidth) |
1614 | if (ev.xbutton.y < TermWin.int_bwidth) |
1618 | { |
1615 | { |
1619 | scroll_selection_dir = UP; |
1616 | scroll_selection_dir = UP; |
1620 | dist = TermWin.int_bwidth - ev.xbutton.y; |
1617 | dist = TermWin.int_bwidth - ev.xbutton.y; |
1621 | } |
1618 | } |
1622 | else |
1619 | else |
… | |
… | |
1646 | } |
1643 | } |
1647 | } |
1644 | } |
1648 | else if (isScrollbarWindow (ev.xany.window) && scrollbar_isMotion ()) |
1645 | else if (isScrollbarWindow (ev.xany.window) && scrollbar_isMotion ()) |
1649 | { |
1646 | { |
1650 | while (XCheckTypedWindowEvent (display->display, scrollBar.win, |
1647 | while (XCheckTypedWindowEvent (display->display, scrollBar.win, |
1651 | MotionNotify, &ev)) ; |
1648 | MotionNotify, &ev)) |
|
|
1649 | ; |
|
|
1650 | |
1652 | XQueryPointer (display->display, scrollBar.win, |
1651 | XQueryPointer (display->display, scrollBar.win, |
1653 | &unused_root, &unused_child, |
1652 | &unused_root, &unused_child, |
1654 | &unused_root_x, &unused_root_y, |
1653 | &unused_root_x, &unused_root_y, |
1655 | & (ev.xbutton.x), & (ev.xbutton.y), |
1654 | &ev.xbutton.x, &ev.xbutton.y, |
1656 | &unused_mask); |
1655 | &unused_mask); |
1657 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1656 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1658 | scrollbar_size ()); |
1657 | scrollbar_size ()); |
1659 | scr_refresh (refresh_type); |
1658 | scr_refresh (refresh_type); |
1660 | refresh_limit = 0; |
1659 | refresh_limit = 0; |
… | |
… | |
1715 | return; |
1714 | return; |
1716 | } |
1715 | } |
1717 | #endif |
1716 | #endif |
1718 | |
1717 | |
1719 | clickintime = ev.time - MEvent.time < MULTICLICK_TIME; |
1718 | clickintime = ev.time - MEvent.time < MULTICLICK_TIME; |
|
|
1719 | |
1720 | if (reportmode) |
1720 | if (reportmode) |
1721 | { |
1721 | { |
1722 | /* mouse report from vt window */ |
1722 | /* mouse report from vt window */ |
1723 | /* save the xbutton state (for ButtonRelease) */ |
1723 | /* save the xbutton state (for ButtonRelease) */ |
1724 | MEvent.state = ev.state; |
1724 | MEvent.state = ev.state; |
… | |
… | |
1753 | } |
1753 | } |
1754 | else |
1754 | else |
1755 | { |
1755 | { |
1756 | if (ev.button != MEvent.button) |
1756 | if (ev.button != MEvent.button) |
1757 | MEvent.clicks = 0; |
1757 | MEvent.clicks = 0; |
|
|
1758 | |
1758 | switch (ev.button) |
1759 | switch (ev.button) |
1759 | { |
1760 | { |
1760 | case Button1: |
1761 | case Button1: |
|
|
1762 | /* allow meta + click to select rectangular areas */ |
|
|
1763 | /* should be done in screen.C */ |
|
|
1764 | #if ENABLE_FRILLS |
|
|
1765 | selection.rect = !! (ev.state & ModMetaMask); |
|
|
1766 | #else |
|
|
1767 | selection.rect = false; |
|
|
1768 | #endif |
|
|
1769 | |
1761 | /* allow shift+left click to extend selection */ |
1770 | /* allow shift+left click to extend selection */ |
1762 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1771 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1763 | { |
1772 | { |
1764 | if (MEvent.button == Button1 && clickintime) |
1773 | if (MEvent.button == Button1 && clickintime) |
1765 | selection_rotate (ev.x, ev.y); |
1774 | selection_rotate (ev.x, ev.y); |
… | |
… | |
3753 | break; |
3762 | break; |
3754 | case XTerm_Color_RV: |
3763 | case XTerm_Color_RV: |
3755 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
3764 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
3756 | break; |
3765 | break; |
3757 | #endif |
3766 | #endif |
3758 | #if TRANSPARENT || TINTING |
3767 | #if TRANSPARENT && TINTING |
3759 | case XTerm_Color_tint: |
3768 | case XTerm_Color_tint: |
3760 | process_color_seq (XTerm_Color_tint, Color_tint, str, resp); |
3769 | process_color_seq (XTerm_Color_tint, Color_tint, str, resp); |
3761 | check_our_parents (); |
3770 | check_our_parents (); |
3762 | if (am_transparent) |
3771 | if (am_transparent) |
3763 | want_full_refresh = want_refresh = 1; |
3772 | want_full_refresh = want_refresh = 1; |