From: Dana Jansens Date: Mon, 18 Feb 2008 20:55:59 +0000 (-0500) Subject: Grab key bindings with GrabModeSync, so that if they lead to a keyboard grab, then... X-Git-Tag: release-3.4.7-pre1~10^2~1 X-Git-Url: http://git.openbox.org/?p=mikachu%2Fopenbox.git;a=commitdiff_plain;h=5bfa48dcffec3b00d119d851cb2427a43f80aa7b;hp=58788c781713092c6aa3a4544f8a06cd499ec4fd Grab key bindings with GrabModeSync, so that if they lead to a keyboard grab, then no keyboard events will be lost between the initial keybinding and the keyboard grab. --- diff --git a/openbox/grab.c b/openbox/grab.c index 43e9a81..214666e 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -222,7 +222,7 @@ void ungrab_passive_key(void) { /*ob_debug("ungrabbing %d passive grabs\n", passive_count);*/ if (passive_count) { - /* kill out passive grab */ + /* kill our passive grab */ XUngrabKeyboard(ob_display, event_curtime); passive_count = 0; } diff --git a/openbox/keyboard.c b/openbox/keyboard.c index c23d83e..c318a4c 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -53,13 +53,13 @@ static void grab_keys(gboolean grab) while (p) { if (p->key) grab_key(p->key, p->state, RootWindow(ob_display, ob_screen), - GrabModeAsync); + GrabModeSync); p = p->next_sibling; } if (curpos) grab_key(config_keyboard_reset_keycode, config_keyboard_reset_state, - RootWindow(ob_display, ob_screen), GrabModeAsync); + RootWindow(ob_display, ob_screen), GrabModeSync); } } @@ -263,6 +263,8 @@ void keyboard_event(ObClient *client, const XEvent *e) } p = p->next_sibling; } + + XAllowEvents(ob_display, AsyncKeyboard, event_curtime); } static void node_rebind(KeyBindingTree *node)