5 static guint kgrabs, pgrabs;
7 void grab_keyboard(gboolean grab)
11 XGrabKeyboard(ob_display, ob_root, 0, GrabModeAsync, GrabModeSync,
13 } else if (kgrabs > 0) {
15 XUngrabKeyboard(ob_display, CurrentTime);
19 void grab_pointer(gboolean grab, Cursor cur)
23 XGrabPointer(ob_display, ob_root, False, 0, GrabModeAsync,
24 GrabModeSync, FALSE, cur, CurrentTime);
25 } else if (pgrabs > 0) {
27 XUngrabPointer(ob_display, CurrentTime);
38 while (kgrabs) grab_keyboard(FALSE);
39 while (pgrabs) grab_pointer(FALSE, None);