Introduction
Introduction Statistics Contact Development Disclaimer Help
tFix keyboard handling when using xwayland - ledit - Text editor (WIP)
git clone git://lumidify.org/ledit.git (fast, but not encrypted)
git clone https://lumidify.org/git/ledit.git (encrypted, but very slow)
Log
Files
Refs
README
LICENSE
---
commit da620ad0dd9ca2e768f6d0289d25ecb51e2415d2
parent 943b164b4033d4e0c1b667bff9c086faf4007e78
Author: lumidify <[email protected]>
Date: Thu, 21 Dec 2023 19:47:37 +0100
Fix keyboard handling when using xwayland
Diffstat:
M ledit.c | 31 +++++++++++++++++++++--------…
1 file changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/ledit.c b/ledit.c
t@@ -490,17 +490,28 @@ mainloop(void) {
if (!test_extra && change_kbd) {
change_kbd = 0;
- XkbStateRec s;
- XkbGetState(common.dpy, XkbUseCoreKbd, &s);
- XkbDescPtr desc = XkbGetKeyboard(
- common.dpy, XkbAllComponentsMask, XkbUseCoreKbd
+ XkbDescPtr desc = XkbGetMap(
+ common.dpy, 0, XkbUseCoreKbd
);
- char *group = XGetAtomName(
- common.dpy, desc->names->groups[s.group]
- );
- change_keyboard(group);
- XFree(group);
- XkbFreeKeyboard(desc, XkbAllComponentsMask, True);
+ if (!desc || XkbGetNames(common.dpy, XkbGroupNamesMask…
+ /* FIXME: maybe show this as error message in …
+ fprintf(
+ stderr,
+ "Unable to obtain keyboard layout info…
+ );
+ if (desc)
+ XkbFreeClientMap(desc, 0, True);
+ } else {
+ XkbStateRec s;
+ XkbGetState(common.dpy, XkbUseCoreKbd, &s);
+ char *group = XGetAtomName(
+ common.dpy, desc->names->groups[s.group]
+ );
+ change_keyboard(group);
+ XFree(group);
+ XkbFreeNames(desc, XkbGroupNamesMask, True);
+ XkbFreeClientMap(desc, 0, True);
+ }
}
redraw();
You are viewing proxied material from lumidify.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.