… | |
… | |
36 | #include "rxvtutil.h" |
36 | #include "rxvtutil.h" |
37 | #include "rxvtperl.h" |
37 | #include "rxvtperl.h" |
38 | |
38 | |
39 | #include "perlxsi.c" |
39 | #include "perlxsi.c" |
40 | |
40 | |
|
|
41 | #if defined(HAVE_SCROLLBARS) || defined(MENUBAR) |
|
|
42 | # define GRAB_CURSOR THIS->leftptr_cursor |
|
|
43 | #else |
|
|
44 | # define GRAB_CURSOR None |
|
|
45 | #endif |
|
|
46 | |
41 | #undef LINENO |
47 | #undef LINENO |
42 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
48 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
43 | #undef ROW |
49 | #undef ROW |
44 | #define ROW(n) THIS->row_buf [LINENO (n)] |
50 | #define ROW(n) THIS->row_buf [LINENO (n)] |
45 | |
51 | |
… | |
… | |
735 | void |
741 | void |
736 | rxvt_term::grab_button (int button, U32 modifiers) |
742 | rxvt_term::grab_button (int button, U32 modifiers) |
737 | CODE: |
743 | CODE: |
738 | XGrabButton (THIS->display->display, button, modifiers, THIS->vt, 1, |
744 | XGrabButton (THIS->display->display, button, modifiers, THIS->vt, 1, |
739 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
745 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
740 | GrabModeSync, GrabModeSync, None, None); |
746 | GrabModeSync, GrabModeSync, None, GRAB_CURSOR); |
741 | |
747 | |
742 | bool |
748 | bool |
743 | rxvt_term::grab (U32 eventtime, int sync = 0) |
749 | rxvt_term::grab (U32 eventtime, int sync = 0) |
744 | CODE: |
750 | CODE: |
745 | { |
751 | { |
… | |
… | |
747 | |
753 | |
748 | THIS->perl.grabtime = 0; |
754 | THIS->perl.grabtime = 0; |
749 | |
755 | |
750 | if (!XGrabPointer (THIS->display->display, THIS->vt, 0, |
756 | if (!XGrabPointer (THIS->display->display, THIS->vt, 0, |
751 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
757 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
752 | mode, mode, None, None, eventtime)) |
758 | mode, mode, None, GRAB_CURSOR, eventtime)) |
753 | if (!XGrabKeyboard (THIS->display->display, THIS->vt, 0, mode, mode, eventtime)) |
759 | if (!XGrabKeyboard (THIS->display->display, THIS->vt, 0, mode, mode, eventtime)) |
754 | THIS->perl.grabtime = eventtime; |
760 | THIS->perl.grabtime = eventtime; |
755 | else |
761 | else |
756 | XUngrabPointer (THIS->display->display, eventtime); |
762 | XUngrabPointer (THIS->display->display, eventtime); |
757 | |
763 | |