diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-30 21:39:12 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-30 21:39:12 +0000 |
| commit | f7a0eb7624fa323a37f9fb0e306d7e1bbc745e15 (patch) | |
| tree | 65d4d080f359dff7a3a3de099f1bfc03bfe207ee /src/bindings.cc | |
| parent | 3409b046a043d8ffabf2e9c33ea037c2e5be15e4 (diff) | |
grab the keyboard during move/resize to make sure the popup doesnt get left onscreen if the modifiers are released before the button
Diffstat (limited to 'src/bindings.cc')
| -rw-r--r-- | src/bindings.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/bindings.cc b/src/bindings.cc index 783b6479..a3694102 100644 --- a/src/bindings.cc +++ b/src/bindings.cc @@ -385,9 +385,6 @@ bool Bindings::grabKeyboard(int screen, PyObject *callback) if (XGrabKeyboard(**otk::display, root, false, GrabModeAsync, GrabModeAsync, CurrentTime)) return false; - // the pointer grab causes pointer events during the keyboard grab to go away - XGrabPointer(**otk::display, root, false, 0, GrabModeAsync, - GrabModeAsync, None, None, CurrentTime); _keybgrab_callback = callback; return true; } @@ -403,6 +400,24 @@ void Bindings::ungrabKeyboard() } +bool Bindings::grabPointer(int screen) +{ + if (!openbox->screen(screen)) + return false; // the screen is not managed + + Window root = otk::display->screenInfo(screen)->rootWindow(); + XGrabPointer(**otk::display, root, false, 0, GrabModeAsync, + GrabModeAsync, None, None, CurrentTime); + return true; +} + + +void Bindings::ungrabPointer() +{ + XUngrabPointer(**otk::display, CurrentTime); +} + + void Bindings::fireKey(int screen, unsigned int modifiers, unsigned int key, Time time, KeyAction::KA action) { |
