From: Dana Jansens Date: Sat, 29 Mar 2003 00:48:32 +0000 (+0000) Subject: don't die when someone else has a key grabbed X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=475fb805f2bac50d3c0bb4c35a743b54bd10e650;p=chaz%2Fopenbox don't die when someone else has a key grabbed --- diff --git a/openbox/grab.c b/openbox/grab.c index f90eb6b5..830c0002 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -1,5 +1,6 @@ #include "openbox.h" #include "event.h" +#include "xerror.h" #include #include @@ -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()