From a9ce3ba2663177b002a676a140dc512f41ba2263 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 12 Aug 2003 08:23:56 +0000 Subject: [PATCH] only do shit with the grabbed_* when a grab is in place --- openbox/keyboard.c | 62 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 607941dd..513b6e1e 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -127,47 +127,47 @@ gboolean keyboard_process_interactive_grab(const XEvent *e, if (interactive_grab) { *client = grabbed_client; *context = grabbed_context; - } - if ((e->type == KeyRelease && - !(grabbed_state & e->xkey.state))) - done = TRUE; - else if (e->type == KeyPress) { - if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN)) + if ((e->type == KeyRelease && + !(grabbed_state & e->xkey.state))) done = TRUE; - else if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) { + 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)) { + if (grabbed_action->func == action_cycle_windows) { + grabbed_action->data.cycle.cancel = TRUE; + } + if (grabbed_action->func == action_desktop_dir) { + grabbed_action->data.desktopdir.cancel = TRUE; + } + if (grabbed_action->func == action_send_to_desktop_dir) + { + grabbed_action->data.sendtodir.cancel = TRUE; + } + done = TRUE; + } + } + if (done) { if (grabbed_action->func == action_cycle_windows) { - grabbed_action->data.cycle.cancel = TRUE; + grabbed_action->data.cycle.final = TRUE; } if (grabbed_action->func == action_desktop_dir) { - grabbed_action->data.desktopdir.cancel = TRUE; + grabbed_action->data.desktopdir.final = TRUE; } - if (grabbed_action->func == action_send_to_desktop_dir) - { - grabbed_action->data.sendtodir.cancel = TRUE; + if (grabbed_action->func == action_send_to_desktop_dir) { + grabbed_action->data.sendtodir.final = TRUE; } - done = TRUE; - } - } - if (done) { - if (grabbed_action->func == action_cycle_windows) { - grabbed_action->data.cycle.final = TRUE; - } - if (grabbed_action->func == action_desktop_dir) { - grabbed_action->data.desktopdir.final = TRUE; - } - if (grabbed_action->func == action_send_to_desktop_dir) { - grabbed_action->data.sendtodir.final = TRUE; - } - grabbed_action->func(&grabbed_action->data); + grabbed_action->func(&grabbed_action->data); - interactive_grab = FALSE; - grab_keyboard(FALSE); - grab_pointer(FALSE, None); - keyboard_reset_chains(); + interactive_grab = FALSE; + grab_keyboard(FALSE); + grab_pointer(FALSE, None); + keyboard_reset_chains(); - handled = TRUE; + handled = TRUE; + } } return handled; -- 2.45.2