]> Dogcows Code - chaz/openbox/blobdiff - openbox/grab.c
grab the pointer Async for key grabs, lets key bindings like <execute>xkill</execute...
[chaz/openbox] / openbox / grab.c
index 2d8877841fd1145de68b7eb59fbceb21291f460a..599fb6815a19444712725e124b4b8139bf70e792 100644 (file)
@@ -30,6 +30,7 @@ gboolean grab_keyboard(gboolean grab)
             XUngrabKeyboard(ob_display, event_lasttime);
         ret = TRUE;
     }
+
     return ret;
 }
 
@@ -120,9 +121,14 @@ void grab_button_full(guint button, guint state, Window win, guint mask,
 {
     guint i;
 
+    xerror_set_ignore(TRUE); /* can get BadAccess' from these */
+    xerror_occured = FALSE;
     for (i = 0; i < MASK_LIST_SIZE; ++i)
         XGrabButton(ob_display, button, state | mask_list[i], win, FALSE, mask,
                     pointer_mode, GrabModeSync, None, ob_cursor(cur));
+    xerror_set_ignore(FALSE);
+    if (xerror_occured)
+        g_warning("failed to grab button %d modifiers %d", button, state);
 }
 
 void grab_button(guint button, guint state, Window win, guint mask)
@@ -146,7 +152,7 @@ void grab_key(guint keycode, guint state, Window win, int keyboard_mode)
     xerror_occured = FALSE;
     for (i = 0; i < MASK_LIST_SIZE; ++i)
         XGrabKey(ob_display, keycode, state | mask_list[i], win, FALSE,
-                 GrabModeSync, keyboard_mode);
+                 GrabModeAsync, keyboard_mode);
     xerror_set_ignore(FALSE);
     if (xerror_occured)
         g_warning("failed to grab keycode %d modifiers %d", keycode, state);
This page took 0.022242 seconds and 4 git commands to generate.