Unable to load xkb keymap with custom xkb_types after upgrade to 21.1
I use a custom keymap to make modifiers and shortcuts more interchangeable with macOS, including an xkb_type
called COMMAND_OPTION
, which typically appears as the last type in the .xkb
file produced by xkbcomp
(attached).
For reference, here's the keymap description I use (it's a pretty standard US pc105 keymap with a few extras added):
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete+command_option" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(evdev)+lk_platform+macos+tenkeyless" };
xkb_geometry { include "pc(pc105)" };
};
It stopped working after Arch Linux updated xorg-server to 21.1 and I believe it's related to de940e06 (xkb: fix key type index check in _XkbSetMapChecks
). Here's the error emitted by xkbcomp
:
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 135 (XKEYBOARD)
Minor opcode of failed request: 9 (XkbSetMap)
Value in failed request: 0x1571001c
Serial number of failed request: 124
Current serial number in output stream: 130
If I temporarily remove the symbols that reference COMMAND_OPTION
from the keymap, it loads without issue, and if I subsequently load the full keymap, it loads successfully. It also works--in one operation--if I move COMMAND_OPTION
to second-last place in the xkb_types
list, presumably because I don't have any references to FOUR_LEVEL_KEYPAD
, which is now last, elsewhere in my keymap. (I'm taking advantage of this as a workaround.)
It's not clear to me if this error relates to the index check implementation in xkb.c
or the way keymaps are loaded by xkbcomp
, so please let me know if I should file this elsewhere, but I figured it was an edge case worth reporting in case there are wider ramifications. (I realise my keymap might be invalid, too -- but given it's been working until now, it would be good to know how I broke it if so, and I'll plug the documentation gap as best I can.)