diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-08-20 23:25:59 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-08-20 23:25:59 +0000 |
| commit | d8d1eb53cdc86a8a5f5cbee730a011c010ad5f18 (patch) | |
| tree | e406cf9502684d09c5ded6f6d095b910c049b0c0 | |
| parent | a098c2437e96d58c647559b46278bc92954e9bbe (diff) | |
better handling of starting a new interactive grab while one is in progress
| -rw-r--r-- | openbox/keyboard.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/openbox/keyboard.c b/openbox/keyboard.c index bcac0a3c..5bda7a7b 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -112,14 +112,20 @@ gboolean keyboard_bind(GList *keylist, ObAction *action) void keyboard_interactive_grab(guint state, ObClient *client, ObFrameContext context, ObAction *action) { - if (!interactive_grab && grab_keyboard(TRUE)) { + if (!interactive_grab) { + if (!grab_keyboard(TRUE)) + return; + if (!grab_pointer(TRUE, None)) { + grab_keyboard(FALSE); + return; + } interactive_grab = TRUE; - grabbed_state = state; - grabbed_client = client; - grabbed_action = action; - grabbed_context = context; - grab_pointer(TRUE, None); } + + grabbed_state = state; + grabbed_client = client; + grabbed_action = action; + grabbed_context = context; } gboolean keyboard_process_interactive_grab(const XEvent *e, |
