From c8983c42a7c27321d18825f2a130c15e29046f7b Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 25 Apr 2007 14:13:32 +0000 Subject: playing a bit with grabs make mouse clicks cancel alt-tab and stuff if you arent dragging during the alt-tab --- openbox/keyboard.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'openbox/keyboard.c') diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 6adb0aa9..f9716c30 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -159,8 +159,11 @@ gboolean keyboard_interactive_grab(guint state, ObClient *client, g_assert(action->data.any.interactive); if (!interactive_states) { - if (!grab_keyboard(TRUE)) + grab_pointer(TRUE, FALSE, OB_CURSOR_POINTER); + if (!grab_keyboard(TRUE)) { + grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); return FALSE; + } } s = g_new(ObInteractiveState, 1); @@ -186,6 +189,7 @@ void keyboard_interactive_end(ObInteractiveState *s, if (!interactive_states) { grab_keyboard(FALSE); + grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); keyboard_reset_chains(); } } @@ -224,7 +228,9 @@ gboolean keyboard_process_interactive_grab(const XEvent *e, ObClient **client) done = TRUE; else */if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) cancel = done = TRUE; - } + } else if (e->type == ButtonPress) + cancel = done = TRUE; + if (done) { keyboard_interactive_end(s, e->xkey.state, cancel, e->xkey.time); -- cgit v1.2.3