[mutter] meta_accelerator_parse(): handle keysyms without the XF86 prefix



commit 8d29d22e991f8816f47529e366a947b3565993e8
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Apr 10 11:58:32 2014 -0700

    meta_accelerator_parse(): handle keysyms without the XF86 prefix
    
    The GDK and hence GNOME standard is that keys that begin with XF86 according to
    libxkbcommon not prefixed with XF86, though gdk_keyval_from_name() strips XF86
    if provided. If libxkbcommon doesn't recognize the accelerator name without
    XF86, try again adding XF86 to the start.
    
    This restores compatibility with gnome-settings-daemon, schemas, and existing
    user configuration.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727993

 src/core/meta-accel-parse.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/core/meta-accel-parse.c b/src/core/meta-accel-parse.c
index 20218c6..f4c5ee0 100644
--- a/src/core/meta-accel-parse.c
+++ b/src/core/meta-accel-parse.c
@@ -309,9 +309,16 @@ accelerator_parse (const gchar         *accelerator,
               keyval = xkb_keysym_from_name (accelerator, XKB_KEYSYM_CASE_INSENSITIVE);
              if (keyval == XKB_KEY_NoSymbol)
                {
-                 error = TRUE;
-                 goto out;
-               }
+                  char *with_xf86 = g_strconcat ("XF86", accelerator, NULL);
+                  keyval = xkb_keysym_from_name (with_xf86, XKB_KEYSYM_CASE_INSENSITIVE);
+                  g_free (with_xf86);
+
+                  if (keyval == XKB_KEY_NoSymbol)
+                    {
+                      error = TRUE;
+                      goto out;
+                    }
+                }
            }
 
           accelerator += len;


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