From 8d29d22e991f8816f47529e366a947b3565993e8 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 10 Apr 2014 11:58:32 -0700 Subject: [PATCH] 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 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/meta-accel-parse.c b/src/core/meta-accel-parse.c index 20218c66e..f4c5ee0bb 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;