]> Dogcows Code - chaz/openbox/blobdiff - src/bindings.cc
grab the keyboard during move/resize to make sure the popup doesnt get left onscreen...
[chaz/openbox] / src / bindings.cc
index 783b6479c2b2d03cdea56828dc80f423346c2405..a369410294786d003772097aeb910c94baa8b504 100644 (file)
@@ -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)
 {
This page took 0.022841 seconds and 4 git commands to generate.