[mutter] keybindings: Don't use the keysym to match keybindings



commit 2bf844d58589392b38f7abd574c05eadef8a6d7d
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Feb 26 19:01:52 2014 +0100

    keybindings: Don't use the keysym to match keybindings
    
    We don't want to match the keysym so that e.g. an accelerator
    specified as "<Super>a" works if the current keymap has a keysym other
    than 'a' for that keycode which means that the accelerator would
    become inaccessible in a non-latin keymap.
    
    This is inconvenient for users that often switch keyboard layouts, or
    even have different layouts in different windows, since they expect
    system-level keybindings to not be affected by the current layout.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678001

 src/core/keybindings.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index db9090e..4bd724f 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -749,7 +749,6 @@ grab_key_bindings (MetaDisplay *display)
 
 static MetaKeyBinding *
 display_get_keybinding (MetaDisplay  *display,
-                        unsigned int  keysym,
                         unsigned int  keycode,
                         unsigned long mask)
 {
@@ -758,8 +757,7 @@ display_get_keybinding (MetaDisplay  *display,
   i = display->n_key_bindings - 1;
   while (i >= 0)
     {
-      if (display->key_bindings[i].keysym == keysym &&
-          display->key_bindings[i].keycode == keycode &&
+      if (display->key_bindings[i].keycode == keycode &&
           display->key_bindings[i].mask == mask)
         {
           return &display->key_bindings[i];
@@ -909,7 +907,6 @@ meta_display_get_keybinding_action (MetaDisplay  *display,
                                     unsigned long mask)
 {
   MetaKeyBinding *binding;
-  KeySym keysym;
 
   /* This is much more vague than the MetaDisplay::overlay-key signal,
    * which is only emitted if the overlay-key is the only key pressed;
@@ -920,12 +917,8 @@ meta_display_get_keybinding_action (MetaDisplay  *display,
   if (keycode == (unsigned int)display->overlay_key_combo.keycode)
     return META_KEYBINDING_ACTION_OVERLAY_KEY;
 
-  keysym = XKeycodeToKeysym (display->xdisplay, keycode, 0);
   mask = mask & 0xff & ~display->ignored_modifier_mask;
-  binding = display_get_keybinding (display, keysym, keycode, mask);
-
-  if (!binding && keycode == meta_display_get_above_tab_keycode (display))
-    binding = display_get_keybinding (display, META_KEY_ABOVE_TAB, keycode, mask);
+  binding = display_get_keybinding (display, keycode, mask);
 
   if (binding)
     {
@@ -1790,7 +1783,6 @@ process_overlay_key (MetaDisplay *display,
                          XIAsyncDevice, event->time);
 
           binding = display_get_keybinding (display,
-                                            display->overlay_key_combo.keysym,
                                             display->overlay_key_combo.keycode,
                                             display->grab_mask);
           if (binding &&


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