1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-07 14:24:14 +01:00

WPrefs: Added XKeycodeToKeysym work-around to all other usage places

To ensure proper behaviour with X servers that do not support the
Xkb extension, implemented call to the fall-back legacy function
to the other places where it is being used, to ensure proper
behaviour in any case.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-06-15 14:38:44 +02:00
committed by Carlos R. Mafra
parent 0382dd5dd7
commit 39ecbc1084
2 changed files with 15 additions and 2 deletions

View File

@@ -273,7 +273,10 @@ char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
XAllowEvents(dpy, AsyncKeyboard, CurrentTime); XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
WMNextEvent(dpy, &ev); WMNextEvent(dpy, &ev);
if (ev.type == KeyPress && ev.xkey.keycode != 0) { if (ev.type == KeyPress && ev.xkey.keycode != 0) {
ksym = XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, 0); if (xext_xkb_supported)
ksym = XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, 0);
else
ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0);
if (!IsModifierKey(ksym)) { if (!IsModifierKey(ksym)) {
if (convert_case) { if (convert_case) {
XConvertCase(ksym, &lksym, &uksym); XConvertCase(ksym, &lksym, &uksym);

View File

@@ -162,7 +162,17 @@ static void x_reset_modifier_mapping(Display * display)
for (column = 0; column < 4; column += 2) { for (column = 0; column < 4; column += 2) {
KeyCode code = x_modifier_keymap->modifiermap[modifier_index * mkpm KeyCode code = x_modifier_keymap->modifiermap[modifier_index * mkpm
+ modifier_key]; + modifier_key];
KeySym sym = (code ? XkbKeycodeToKeysym(display, code, 0, column) : 0); KeySym sym;
if (code) {
if (xext_xkb_supported)
sym = XkbKeycodeToKeysym(display, code, 0, column);
else
sym = XKeycodeToKeysym(display, code, column);
} else {
sym = NoSymbol;
}
if (sym == last_sym) if (sym == last_sym)
continue; continue;
last_sym = sym; last_sym = sym;