X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fkeyboard.c;h=516503488ac59df1d1c9e8b326e9c693fe35c2ac;hb=e3786e64fb0786632b89ff086b818c0a3b0522b7;hp=1499421353597377dff61036373fef075a0eac3f;hpb=0aa7f70d91245d4a523c625d978063675ffc3ac7;p=chaz%2Fopenbox diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 14994213..51650348 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; } } @@ -236,9 +229,9 @@ gboolean keyboard_process_interactive_grab(const XEvent *e, ObClient **client) !(s->state & e->xkey.state))) done = TRUE; else if (e->type == KeyPress) { - if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN)) + /*if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN)) done = TRUE; - else if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) + else */if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) cancel = done = TRUE; } if (done) { @@ -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)