… | |
… | |
910 | #endif /* MENUBAR_MAX */ |
910 | #endif /* MENUBAR_MAX */ |
911 | |
911 | |
912 | void |
912 | void |
913 | rxvt_term::flush () |
913 | rxvt_term::flush () |
914 | { |
914 | { |
|
|
915 | flush_ev.stop (); |
|
|
916 | |
915 | #ifdef TRANSPARENT |
917 | #ifdef TRANSPARENT |
916 | if (want_full_refresh) |
918 | if (want_full_refresh) |
917 | { |
919 | { |
918 | want_full_refresh = 0; |
920 | want_full_refresh = 0; |
919 | scr_clear (); |
921 | scr_clear (); |
… | |
… | |
929 | IMSendSpot (); |
931 | IMSendSpot (); |
930 | #endif |
932 | #endif |
931 | } |
933 | } |
932 | |
934 | |
933 | display->flush (); |
935 | display->flush (); |
934 | |
|
|
935 | flush_ev.stop (); |
|
|
936 | } |
936 | } |
937 | |
937 | |
938 | void |
938 | void |
939 | rxvt_term::check_cb (check_watcher &w) |
939 | rxvt_term::check_cb (check_watcher &w) |
940 | { |
940 | { |
… | |
… | |
1214 | pointer_unblank (); |
1214 | pointer_unblank (); |
1215 | |
1215 | |
1216 | if (ev.type == KeyPress && hidden_pointer == 0) |
1216 | if (ev.type == KeyPress && hidden_pointer == 0) |
1217 | pointer_blank (); |
1217 | pointer_blank (); |
1218 | } |
1218 | } |
1219 | #endif |
|
|
1220 | |
|
|
1221 | #ifdef USE_XIM |
|
|
1222 | if (XFilterEvent (&ev, None)) |
|
|
1223 | return; |
|
|
1224 | #endif |
1219 | #endif |
1225 | |
1220 | |
1226 | Window unused_root, unused_child; |
1221 | Window unused_root, unused_child; |
1227 | int unused_root_x, unused_root_y; |
1222 | int unused_root_x, unused_root_y; |
1228 | unsigned int unused_mask; |
1223 | unsigned int unused_mask; |
… | |
… | |
1562 | { |
1557 | { |
1563 | menubar_control (ev.xbutton); |
1558 | menubar_control (ev.xbutton); |
1564 | break; |
1559 | break; |
1565 | } |
1560 | } |
1566 | #endif |
1561 | #endif |
1567 | if ((priv_modes & PrivMode_mouse_report) && ! (bypass_keystate)) |
1562 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1568 | break; |
1563 | break; |
1569 | |
1564 | |
1570 | if (ev.xany.window == TermWin.vt) |
1565 | if (ev.xany.window == TermWin.vt) |
1571 | { |
1566 | { |
1572 | if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
1567 | if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
… | |
… | |
1575 | ; |
1570 | ; |
1576 | |
1571 | |
1577 | XQueryPointer (display->display, TermWin.vt, |
1572 | XQueryPointer (display->display, TermWin.vt, |
1578 | &unused_root, &unused_child, |
1573 | &unused_root, &unused_child, |
1579 | &unused_root_x, &unused_root_y, |
1574 | &unused_root_x, &unused_root_y, |
1580 | & (ev.xbutton.x), & (ev.xbutton.y), |
1575 | &ev.xbutton.x, &ev.xbutton.y, |
1581 | &unused_mask); |
1576 | &ev.xbutton.state); |
1582 | #ifdef MOUSE_THRESHOLD |
1577 | #ifdef MOUSE_THRESHOLD |
1583 | /* deal with a `jumpy' mouse */ |
1578 | /* deal with a `jumpy' mouse */ |
1584 | if ((ev.xmotion.time - MEvent.time) > MOUSE_THRESHOLD) |
1579 | if ((ev.xmotion.time - MEvent.time) > MOUSE_THRESHOLD) |
1585 | { |
1580 | { |
1586 | #endif |
1581 | #endif |
… | |
… | |
1591 | iso14755_54 (ev.xbutton.x, ev.xbutton.y); |
1586 | iso14755_54 (ev.xbutton.x, ev.xbutton.y); |
1592 | break; |
1587 | break; |
1593 | } |
1588 | } |
1594 | #endif |
1589 | #endif |
1595 | selection_extend (ev.xbutton.x, ev.xbutton.y, |
1590 | selection_extend (ev.xbutton.x, ev.xbutton.y, |
1596 | (ev.xbutton.state & Button3Mask) ? 2 : 0); |
1591 | ev.xbutton.state & Button3Mask ? 2 : 0); |
|
|
1592 | |
1597 | #ifdef SELECTION_SCROLLING |
1593 | #ifdef SELECTION_SCROLLING |
1598 | if (ev.xbutton.y < TermWin.int_bwidth |
1594 | if (ev.xbutton.y < TermWin.int_bwidth |
1599 | || Pixel2Row (ev.xbutton.y) > (TermWin.nrow-1)) |
1595 | || Pixel2Row (ev.xbutton.y) > (TermWin.nrow-1)) |
1600 | { |
1596 | { |
1601 | int dist; |
1597 | int dist; |
… | |
… | |
1612 | selection_save_x = ev.xbutton.x; |
1608 | selection_save_x = ev.xbutton.x; |
1613 | selection_save_y = ev.xbutton.y; |
1609 | selection_save_y = ev.xbutton.y; |
1614 | selection_save_state = (ev.xbutton.state & Button3Mask) ? 2 : 0; |
1610 | selection_save_state = (ev.xbutton.state & Button3Mask) ? 2 : 0; |
1615 | |
1611 | |
1616 | /* calc number of lines to scroll */ |
1612 | /* calc number of lines to scroll */ |
1617 | if (ev.xbutton.y<TermWin.int_bwidth) |
1613 | if (ev.xbutton.y < TermWin.int_bwidth) |
1618 | { |
1614 | { |
1619 | scroll_selection_dir = UP; |
1615 | scroll_selection_dir = UP; |
1620 | dist = TermWin.int_bwidth - ev.xbutton.y; |
1616 | dist = TermWin.int_bwidth - ev.xbutton.y; |
1621 | } |
1617 | } |
1622 | else |
1618 | else |
… | |
… | |
1646 | } |
1642 | } |
1647 | } |
1643 | } |
1648 | else if (isScrollbarWindow (ev.xany.window) && scrollbar_isMotion ()) |
1644 | else if (isScrollbarWindow (ev.xany.window) && scrollbar_isMotion ()) |
1649 | { |
1645 | { |
1650 | while (XCheckTypedWindowEvent (display->display, scrollBar.win, |
1646 | while (XCheckTypedWindowEvent (display->display, scrollBar.win, |
1651 | MotionNotify, &ev)) ; |
1647 | MotionNotify, &ev)) |
|
|
1648 | ; |
|
|
1649 | |
1652 | XQueryPointer (display->display, scrollBar.win, |
1650 | XQueryPointer (display->display, scrollBar.win, |
1653 | &unused_root, &unused_child, |
1651 | &unused_root, &unused_child, |
1654 | &unused_root_x, &unused_root_y, |
1652 | &unused_root_x, &unused_root_y, |
1655 | & (ev.xbutton.x), & (ev.xbutton.y), |
1653 | &ev.xbutton.x, &ev.xbutton.y, |
1656 | &unused_mask); |
1654 | &unused_mask); |
1657 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1655 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1658 | scrollbar_size ()); |
1656 | scrollbar_size ()); |
1659 | scr_refresh (refresh_type); |
1657 | scr_refresh (refresh_type); |
1660 | refresh_limit = 0; |
1658 | refresh_limit = 0; |
… | |
… | |
1715 | return; |
1713 | return; |
1716 | } |
1714 | } |
1717 | #endif |
1715 | #endif |
1718 | |
1716 | |
1719 | clickintime = ev.time - MEvent.time < MULTICLICK_TIME; |
1717 | clickintime = ev.time - MEvent.time < MULTICLICK_TIME; |
|
|
1718 | |
1720 | if (reportmode) |
1719 | if (reportmode) |
1721 | { |
1720 | { |
1722 | /* mouse report from vt window */ |
1721 | /* mouse report from vt window */ |
1723 | /* save the xbutton state (for ButtonRelease) */ |
1722 | /* save the xbutton state (for ButtonRelease) */ |
1724 | MEvent.state = ev.state; |
1723 | MEvent.state = ev.state; |
… | |
… | |
1753 | } |
1752 | } |
1754 | else |
1753 | else |
1755 | { |
1754 | { |
1756 | if (ev.button != MEvent.button) |
1755 | if (ev.button != MEvent.button) |
1757 | MEvent.clicks = 0; |
1756 | MEvent.clicks = 0; |
|
|
1757 | |
1758 | switch (ev.button) |
1758 | switch (ev.button) |
1759 | { |
1759 | { |
1760 | case Button1: |
1760 | case Button1: |
|
|
1761 | /* allow meta + click to select rectangular areas */ |
|
|
1762 | /* should be done in screen.C */ |
|
|
1763 | #if ENABLE_FRILLS |
|
|
1764 | selection.rect = !! (ev.state & ModMetaMask); |
|
|
1765 | #else |
|
|
1766 | selection.rect = false; |
|
|
1767 | #endif |
|
|
1768 | |
1761 | /* allow shift+left click to extend selection */ |
1769 | /* allow shift+left click to extend selection */ |
1762 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1770 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1763 | { |
1771 | { |
1764 | if (MEvent.button == Button1 && clickintime) |
1772 | if (MEvent.button == Button1 && clickintime) |
1765 | selection_rotate (ev.x, ev.y); |
1773 | selection_rotate (ev.x, ev.y); |