X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fkeyboard.c;h=05d40cd06b1801c8501c4e1a0818a0d1d4b5d90b;hb=d7f51ce0a63fd757e28aaa2b025e9ef55c96b82e;hp=1499421353597377dff61036373fef075a0eac3f;hpb=0aa7f70d91245d4a523c625d978063675ffc3ac7;p=chaz%2Fopenbox diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 14994213..05d40cd0 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -155,27 +155,19 @@ gboolean keyboard_bind(GList *keylist, ObAction *action) return TRUE; } -gboolean keyboard_interactive_grab_in_progress() -{ - return interactive_states != NULL; -} - -void keyboard_interactive_grab(guint state, ObClient *client, - ObAction *action) +gboolean keyboard_interactive_grab(guint state, ObClient *client, + ObAction *action) { ObInteractiveState *s; g_assert(action->data.any.interactive); - if (moveresize_in_progress) - moveresize_end(FALSE); - if (!interactive_states) { if (!grab_keyboard(TRUE)) - return; + return FALSE; if (!grab_pointer(TRUE, OB_CURSOR_NONE)) { grab_keyboard(FALSE); - return; + return FALSE; } } @@ -186,6 +178,8 @@ void keyboard_interactive_grab(guint state, ObClient *client, s->actions = g_slist_append(NULL, action); interactive_states = g_slist_append(interactive_states, s); + + return TRUE; } void keyboard_interactive_end(ObInteractiveState *s, @@ -205,18 +199,17 @@ void keyboard_interactive_end(ObInteractiveState *s, } } -void keyboard_interactive_end_client(gpointer data) +void keyboard_interactive_end_client(ObClient *client, gpointer data) { GSList *it, *next; - ObClient *c = data; for (it = interactive_states; it; it = next) { ObInteractiveState *s = it->data; next = g_slist_next(it); - if (s->client == c) - keyboard_interactive_end(s, 0, FALSE); + if (s->client == client) + s->client = NULL; } } @@ -299,7 +292,7 @@ void keyboard_startup(gboolean reconfig) grab_keys(TRUE); if (!reconfig) - client_add_destructor(keyboard_interactive_end_client); + client_add_destructor(keyboard_interactive_end_client, NULL); } void keyboard_shutdown(gboolean reconfig)