Recur if the keypress ended a grab, so it can be processed in its own

2007-12-08  Thomas Thurman  <tthurman@gnome.org>

        * src/keybindings.c (meta_display_process_key_event): Recur if the
        keypress ended a grab, so it can be processed in its own right.
        Closes #112560.


svn path=/trunk/; revision=3464
This commit is contained in:
Thomas Thurman 2007-12-09 22:56:12 +00:00 committed by Thomas James Alexander Thurman
parent e7758d64d8
commit 4564236abf
2 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2007-12-08 Thomas Thurman <tthurman@gnome.org>
* src/keybindings.c (meta_display_process_key_event): Recur if the
keypress ended a grab, so it can be processed in its own right.
Closes #112560.
2007-12-08 Martin Meyer <elreydetodo@gmail.com> 2007-12-08 Martin Meyer <elreydetodo@gmail.com>
* src/theme-parser.c (parse_draw_op_element): Fix * src/theme-parser.c (parse_draw_op_element): Fix

View File

@ -1644,6 +1644,17 @@ process_event (MetaKeyBinding *bindings,
"No handler found for this event in this binding table\n"); "No handler found for this event in this binding table\n");
} }
/* Handle a key event. May be called recursively: some key events cause
* grabs to be ended and then need to be processed again in their own
* right. This cannot cause infinite recursion because we never call
* ourselves when there wasn't a grab, and we always clear the grab
* first; the invariant is enforced using an assertion. See #112560.
* FIXME: We need to prove there are no race conditions here.
* FIXME: Does it correctly handle alt-Tab being followed by another
* grabbing keypress without letting go of alt?
* FIXME: An iterative solution would probably be simpler to understand
* (and help us solve the other fixmes).
*/
void void
meta_display_process_key_event (MetaDisplay *display, meta_display_process_key_event (MetaDisplay *display,
MetaWindow *window, MetaWindow *window,
@ -1791,6 +1802,12 @@ meta_display_process_key_event (MetaDisplay *display,
"Ending grab op %u on key event sym %s\n", "Ending grab op %u on key event sym %s\n",
display->grab_op, XKeysymToString (keysym)); display->grab_op, XKeysymToString (keysym));
meta_display_end_grab_op (display, event->xkey.time); meta_display_end_grab_op (display, event->xkey.time);
g_assert (display->grab_op == META_GRAB_OP_NONE);
/* and go round again: #112560 */
meta_display_process_key_event (display, window, event);
} }
} }