diff options
author | fvogel <fvogelnew1@free.fr> | 2018-05-03 06:12:45 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2018-05-03 06:12:45 (GMT) |
commit | 79700d14b1bb5505ca1b6c57c5887f4c3eac1138 (patch) | |
tree | b6a6cef1ecccf6dfd7bc81e1a3433c7b3ed6b794 /unix/tkUnixKey.c | |
parent | c6f4c029dda375ea3bd1410e39e81298847aa724 (diff) | |
download | tk-79700d14b1bb5505ca1b6c57c5887f4c3eac1138.zip tk-79700d14b1bb5505ca1b6c57c5887f4c3eac1138.tar.gz tk-79700d14b1bb5505ca1b6c57c5887f4c3eac1138.tar.bz2 |
Further patch from Christian Werner, on the observation that on Fedora 28 Workstation on x86_64 XKeyEvents generated by input methods have the keycode field set to 0 which fails the range check and thus doesn't get processed further
Diffstat (limited to 'unix/tkUnixKey.c')
-rw-r--r-- | unix/tkUnixKey.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index d8aa5ab..c5a024f 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -146,9 +146,15 @@ TkpGetString( XDisplayKeycodes(winPtr->dispPtr->display, &mincode, &maxcode); if ((eventPtr->xkey.keycode < mincode) || (eventPtr->xkey.keycode > maxcode)) { - len = 0; - Tcl_DStringSetLength(dsPtr, len); - goto done; + if (eventPtr->xkey.keycode != 0) { + len = 0; + Tcl_DStringSetLength(dsPtr, len); + goto done; + } + /* + * Keycode 0 seems to come from e.g. ibus input methods, + * we let this pass and hope for the best. + */ } #ifdef TK_USE_INPUT_METHODS |