XtTranslateKey not processing returned modifiers when compiled for Xkb
For some Xt/Xm programs[1] on some platforms[2] the numeric keypad is stuck in
navigation mode (irrespective of the NumLock state)[3]. I believe I've isolated
the source of the problem to libXt
, specifically when it is compiled with Xkb
support.
The problem seems to lie in the XtTranslateKey(...)
function (in
src/TMkey.c
). When compiled with Xkb
support this simply makes a call to
XkbLookupKeySym(...)
and does no further processing. I believe that what it
should be doing is then processing the returned “list of modifiers that should
still be applied” (per the XkbLookupKeySym(3)
manpage).[4]
To fix the issue I believe XtTranslateKey(...)
should be doing additional
processing, similar to how it handles non-Xkb platforms or something like one
of the following functions:
Links to related bug reports:
[1] The programs I've seen affected are nedit and xnedit.
[2] This was first observed by myself on Ubuntu Linux 22.04 (jammy
).
[3] Except for the 5
key which does follow NumLock
.
[4] Manually editing that function to always use the first block of code (for
no Xkb support) instead of the latter (for Xkb support) makes the problem go
away for nedit
(there is no change in xnedit
's behavior).