summaryrefslogtreecommitdiff
path: root/openbox/keyboard.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-04-25 14:13:32 +0000
committerDana Jansens <danakj@orodu.net>2007-04-25 14:13:32 +0000
commitc8983c42a7c27321d18825f2a130c15e29046f7b (patch)
tree0fc366336c569f7f434a6609d57030af8874a58e /openbox/keyboard.c
parent05560c929ba196c7f0abd8332ccb19650b2cf316 (diff)
playing a bit with grabs
make mouse clicks cancel alt-tab and stuff if you arent dragging during the alt-tab
Diffstat (limited to 'openbox/keyboard.c')
-rw-r--r--openbox/keyboard.c10
1 files changed, 8 insertions, 2 deletions
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);