X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fbindings.cc;h=a369410294786d003772097aeb910c94baa8b504;hb=f7a0eb7624fa323a37f9fb0e306d7e1bbc745e15;hp=78fc74cdfe642f1e5ca1f241104c2c65cc2c5429;hpb=997f94cf8657201ea9d1f2497e4ec4f56342e22f;p=chaz%2Fopenbox diff --git a/src/bindings.cc b/src/bindings.cc index 78fc74cd..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(); } @@ -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); }