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
This commit is contained in:
Owen W. Taylor 2014-04-10 11:58:32 -07:00
parent 9c6e527d4b
commit 8d29d22e99

View File

@ -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;