]> Dogcows Code - chaz/openbox/commitdiff
don't die when someone else has a key grabbed
authorDana Jansens <danakj@orodu.net>
Sat, 29 Mar 2003 00:48:32 +0000 (00:48 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 29 Mar 2003 00:48:32 +0000 (00:48 +0000)
openbox/grab.c

index f90eb6b537d6964a34a5611f8b15f812a69e2da7..830c00022f1a026258e3348a8df6fad4a1ae0f77 100644 (file)
@@ -1,5 +1,6 @@
 #include "openbox.h"
 #include "event.h"
+#include "xerror.h"
 
 #include <glib.h>
 #include <X11/Xlib.h>
@@ -102,9 +103,14 @@ void grab_key(guint keycode, guint state, int keyboard_mode)
 {
     guint i;
 
+    xerror_set_ignore(TRUE); /* can get BadAccess' from these */
+    xerror_occured = FALSE;
     for (i = 0; i < MASK_LIST_SIZE; ++i)
         XGrabKey(ob_display, keycode, state | mask_list[i], ob_root, FALSE,
                  GrabModeAsync, keyboard_mode);
+    xerror_set_ignore(FALSE);
+    if (xerror_occured)
+        g_warning("failed to grab keycode %d modifiers %d", keycode, state);
 }
 
 void ungrab_all_keys()
This page took 0.023762 seconds and 4 git commands to generate.