From 35a493cfa3eb0c91d21aea4f647a6fcac235bb91 Mon Sep 17 00:00:00 2001 From: kb1000 Date: Mon, 10 Feb 2020 17:37:08 +0100 Subject: [PATCH] Fix crash on Xwayland --- source/glfw/src/x11_init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/glfw/src/x11_init.c b/source/glfw/src/x11_init.c index b2d181b..1a85d7d 100644 --- a/source/glfw/src/x11_init.c +++ b/source/glfw/src/x11_init.c @@ -231,9 +231,8 @@ static void updateKeyCodeLUT(void) // keyboard layout // Get keyboard description - descr = XkbGetKeyboard(_glfw.x11.display, - XkbAllComponentsMask, - XkbUseCoreKbd); + descr = XkbGetMap(_glfw.x11.display, 0, XkbUseCoreKbd); + XkbGetNames(_glfw.x11.display, XkbKeyNamesMask, descr); // Find the X11 key code -> GLFW key code mapping for (keyCode = descr->min_key_code; keyCode <= descr->max_key_code; ++keyCode) @@ -304,8 +303,8 @@ static void updateKeyCodeLUT(void) } // Free the keyboard description - XkbFreeKeyboard(descr, 0, True); - + XkbFreeNames(descr, XkbKeyNamesMask, True); + XkbFreeClientMap(descr, 0, True); // Translate the un-translated key codes using traditional X11 KeySym // lookups for (keyCode = 0; keyCode < 256; keyCode++)