[mutter] keybindings: Fix ungrabs possibly failing after switching keymaps



commit 73acbdd30c3d368cae687642fae42425ce855040
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Mar 4 20:33:56 2014 +0100

    keybindings: Fix ungrabs possibly failing after switching keymaps
    
    We need to resolve the keycode from the keysym again since the keycode
    might have changed if there was a keymap switch between the grab and
    the ungrab.

 src/core/keybindings.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 097b423..e97c0f2 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1357,6 +1357,7 @@ meta_display_ungrab_accelerator (MetaDisplay *display,
   MetaKeyGrab *grab;
   char *key;
   guint mask = 0;
+  guint keycode = 0;
 
   g_return_val_if_fail (action != META_KEYBINDING_ACTION_NONE, FALSE);
 
@@ -1366,8 +1367,9 @@ meta_display_ungrab_accelerator (MetaDisplay *display,
     return FALSE;
 
   meta_display_devirtualize_modifiers (display, grab->combo->modifiers, &mask);
+  keycode = keysym_to_keycode (display, grab->combo->keysym);
 
-  binding = display_get_keybinding (display, grab->combo->keycode, mask);
+  binding = display_get_keybinding (display, keycode, mask);
   if (binding)
     {
       guint32 index_key;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]