summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2015-09-21 17:25:40 +0200
committerRui Matos <tiagomatos@gmail.com>2015-09-25 19:09:48 +0200
commit9abc0712836c9e56ed08796645874cc0d10b1826 (patch)
treeeb1a10a6d53599b9d2e076e0fa3599681fe0321f
parenta9df4bb81adb0435cd8eeb6a634c963ba33784a7 (diff)
downloadmutter-9abc0712836c9e56ed08796645874cc0d10b1826.tar.gz
backend-x11: Fallback to a default keymap if getting it from X fails
This shouldn't fail but apparently sometimes it does and in that case having a possibly wrong idea of the keymap is still better than crashing. https://bugzilla.gnome.org/show_bug.cgi?id=754979
-rw-r--r--src/backends/x11/meta-backend-x11.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 7ad28fd11..dbcd13fd2 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -760,6 +760,9 @@ meta_backend_x11_get_keymap (MetaBackend *backend)
priv->xcb,
xkb_x11_get_core_keyboard_device_id (priv->xcb),
XKB_KEYMAP_COMPILE_NO_FLAGS);
+ if (priv->keymap == NULL)
+ priv->keymap = xkb_keymap_new_from_names (context, NULL, XKB_KEYMAP_COMPILE_NO_FLAGS);
+
xkb_context_unref (context);
}