X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fbindings.cc;h=a369410294786d003772097aeb910c94baa8b504;hb=31ae81b34aace753bf250c411e6692a52741e63a;hp=757f66b589d5c96cde988adf5dcc2655a5aadea7;hpb=a20c78f789d653be9f337fbb9c61860a7378f9a3;p=chaz%2Fopenbox diff --git a/src/bindings.cc b/src/bindings.cc index 757f66b5..a3694102 100644 --- a/src/bindings.cc +++ b/src/bindings.cc @@ -159,9 +159,8 @@ Bindings::~Bindings() if (_timer) delete _timer; - grabKeys(false); removeAllKeys(); -// removeAllButtons(); XXX + //removeAllButtons(); // this is done by each client as they are unmanaged removeAllEvents(); } @@ -386,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; } @@ -404,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) {