X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fkeyboard.c;h=84ae2a38e2d25f7eac85b6c4f74644502b2c1641;hb=f3424ddd3b80ccb43e68f832711c7a513f909e1f;hp=cf56ad8f3b99c60640e273e4b0de9d13fc6d6ede;hpb=9a9e3f6bf6be75094636e37d54fb16e4456b43be;p=chaz%2Fopenbox diff --git a/openbox/keyboard.c b/openbox/keyboard.c index cf56ad8f..84ae2a38 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -78,9 +78,11 @@ static gboolean chain_timeout(gpointer data) static void set_curpos(KeyBindingTree *newpos) { - grab_keys(FALSE); - curpos = newpos; - grab_keys(TRUE); + if (curpos != newpos) { + grab_keys(FALSE); + curpos = newpos; + grab_keys(TRUE); + } if (curpos != NULL) { gchar *text = NULL; @@ -193,14 +195,15 @@ static void keyboard_interactive_end(guint state, gboolean cancel, Time time, g_assert(istate.active); + /* ungrab first so they won't be NotifyWhileGrabbed */ + if (ungrab) + grab_keyboard(FALSE); + alist = g_slist_append(NULL, istate.action); action_run_interactive(alist, istate.client, state, time, cancel, TRUE); g_slist_free(alist); istate.active = FALSE; - - if (ungrab) - grab_keyboard(FALSE); } static void keyboard_interactive_end_client(ObClient *client, gpointer data) @@ -247,7 +250,7 @@ gboolean keyboard_process_interactive_grab(const XEvent *e, ObClient **client) handled = TRUE; } } else if (e->type == ButtonPress) { - cancel = FALSE; + cancel = TRUE; done = TRUE; handled = FALSE; }