X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fbindings.cc;h=fcbff769f5e4945506d5460784f5a144c74ccdca;hb=ba87284397e058fc477a04fba2ff2eb815a33de0;hp=78fc74cdfe642f1e5ca1f241104c2c65cc2c5429;hpb=997f94cf8657201ea9d1f2497e4ec4f56342e22f;p=chaz%2Fopenbox diff --git a/src/bindings.cc b/src/bindings.cc index 78fc74cd..fcbff769 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(); } @@ -397,6 +396,25 @@ void Bindings::ungrabKeyboard() _keybgrab_callback = 0; XUngrabKeyboard(**otk::display, CurrentTime); + XUngrabPointer(**otk::display, CurrentTime); +} + + +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); } @@ -424,7 +442,7 @@ void Bindings::fireKey(int screen, unsigned int modifiers, unsigned int key, _timer = new otk::Timer(5000, // 5 second timeout (otk::Timer::TimeoutHandler)resetChains, this); - // grab the server here to make sure no key pressed go missed + // grab the server here to make sure no key presses get missed otk::display->grab(); grabKeys(false); _curpos = p;