From 475fb805f2bac50d3c0bb4c35a743b54bd10e650 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 29 Mar 2003 00:48:32 +0000 Subject: [PATCH] don't die when someone else has a key grabbed --- openbox/grab.c | 6 ++++++ 1 file changed, 6 insertions(+) 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() -- 2.45.2