Fix crash on Xwayland
This commit is contained in:
@@ -231,9 +231,8 @@ static void updateKeyCodeLUT(void)
|
|||||||
// keyboard layout
|
// keyboard layout
|
||||||
|
|
||||||
// Get keyboard description
|
// Get keyboard description
|
||||||
descr = XkbGetKeyboard(_glfw.x11.display,
|
descr = XkbGetMap(_glfw.x11.display, 0, XkbUseCoreKbd);
|
||||||
XkbAllComponentsMask,
|
XkbGetNames(_glfw.x11.display, XkbKeyNamesMask, descr);
|
||||||
XkbUseCoreKbd);
|
|
||||||
|
|
||||||
// Find the X11 key code -> GLFW key code mapping
|
// Find the X11 key code -> GLFW key code mapping
|
||||||
for (keyCode = descr->min_key_code; keyCode <= descr->max_key_code; ++keyCode)
|
for (keyCode = descr->min_key_code; keyCode <= descr->max_key_code; ++keyCode)
|
||||||
@@ -304,8 +303,8 @@ static void updateKeyCodeLUT(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Free the keyboard description
|
// 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
|
// Translate the un-translated key codes using traditional X11 KeySym
|
||||||
// lookups
|
// lookups
|
||||||
for (keyCode = 0; keyCode < 256; keyCode++)
|
for (keyCode = 0; keyCode < 256; keyCode++)
|
||||||
|
|||||||
Reference in New Issue
Block a user