X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fkeyboard.c;h=cf56ad8f3b99c60640e273e4b0de9d13fc6d6ede;hb=6cd5f7ea380e155dbd7b29f01dd3fcfb5858ad61;hp=2c97b93c7ea1ab53fce36a4bc163e64362e991a8;hpb=32630da2bf4f04097d85cb7ff674325e9da3eb54;p=chaz%2Fopenbox diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 2c97b93c..cf56ad8f 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -199,10 +199,8 @@ static void keyboard_interactive_end(guint state, gboolean cancel, Time time, istate.active = FALSE; - if (ungrab) { + if (ungrab) grab_keyboard(FALSE); - grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); - } } static void keyboard_interactive_end_client(ObClient *client, gpointer data) @@ -217,11 +215,8 @@ gboolean keyboard_interactive_grab(guint state, ObClient *client, g_assert(action->data.any.interactive); if (!istate.active) { - grab_pointer(TRUE, FALSE, OB_CURSOR_POINTER); - if (!grab_keyboard(TRUE)) { - grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); + if (!grab_keyboard(TRUE)) return FALSE; - } } else if (action->func != istate.action->func) { keyboard_interactive_end(state, FALSE, action->data.any.time, FALSE); } @@ -241,23 +236,26 @@ gboolean keyboard_process_interactive_grab(const XEvent *e, ObClient **client) gboolean cancel = FALSE; if (istate.active) { - if ((e->type == KeyRelease && !(istate.state & e->xkey.state))) + if ((e->type == KeyRelease && !(istate.state & e->xkey.state))) { done = TRUE; - else if (e->type == KeyPress) { + handled = TRUE; + } else if (e->type == KeyPress) { /*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; + handled = TRUE; + } } else if (e->type == ButtonPress) { cancel = FALSE; done = TRUE; + handled = FALSE; } - if (done) { + if (done) keyboard_interactive_end(e->xkey.state, cancel, e->xkey.time,TRUE); - handled = TRUE; - } else + if (handled) *client = istate.client; }