summaryrefslogtreecommitdiff
path: root/openbox/keyboard.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-05 00:50:53 +0000
committerDana Jansens <danakj@orodu.net>2007-05-05 00:50:53 +0000
commit9a9e3f6bf6be75094636e37d54fb16e4456b43be (patch)
treed6da68af860d34824a5d0a78ff49fc29dc89a339 /openbox/keyboard.c
parent0c15af505fb5bcd5e906e0146f82038b51f73307 (diff)
woa.. let you do mouse actions while in an interactive keyboard action, and let you do keyboard actions while move/resizing. yay. also you can click in windows at the same time..
Diffstat (limited to 'openbox/keyboard.c')
-rw-r--r--openbox/keyboard.c24
1 files changed, 11 insertions, 13 deletions
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;
}