From f6a1d64a2f02158a919bee077c9c540e0a5b6fec Mon Sep 17 00:00:00 2001 From: Alex Baines Date: Fri, 13 Mar 2020 23:03:43 +0000 Subject: [PATCH] seems to fix xwayland xkb issues https://github.com/4coder-editor/4coder/issues/200 --- platform_linux/linux_4ed.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform_linux/linux_4ed.cpp b/platform_linux/linux_4ed.cpp index 99886437..d93d0821 100644 --- a/platform_linux/linux_4ed.cpp +++ b/platform_linux/linux_4ed.cpp @@ -1000,9 +1000,13 @@ linux_x11_init(int argc, char** argv, Plat_Settings* settings) { } XkbSelectEvents(linuxvars.dpy, XkbUseCoreKbd, XkbAllEventsMask, XkbAllEventsMask); - linuxvars.xkb = XkbGetKeyboard(linuxvars.dpy, XkbAllComponentsMask, XkbUseCoreKbd); + linuxvars.xkb = XkbGetMap(linuxvars.dpy, XkbKeyTypesMask | XkbKeySymsMask, XkbUseCoreKbd); if(!linuxvars.xkb) { - system_error_box("Error getting XKB keyboard details."); + system_error_box("Error getting XKB keyboard map."); + } + + if(XkbGetNames(linuxvars.dpy, XkbKeyNamesMask, linuxvars.xkb) != Success) { + system_error_box("Error getting XKB key names."); } // closer to windows behaviour (holding key doesn't generate release events)