diff options
author | dgp <dgp@users.sourceforge.net> | 2013-04-01 17:07:10 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-04-01 17:07:10 (GMT) |
commit | d81f8f7c49270ddc93b4d639c0e7f77767c4fd47 (patch) | |
tree | 64da754277b242dc50862f735d5b4ee523971fa6 /unix/tkUnixKey.c | |
parent | e19cf65c7641a093a5c7cf8325c5466e431d7c69 (diff) | |
parent | b8f8082aad49088238582658c22248f9469ad055 (diff) | |
download | tk-d81f8f7c49270ddc93b4d639c0e7f77767c4fd47.zip tk-d81f8f7c49270ddc93b4d639c0e7f77767c4fd47.tar.gz tk-d81f8f7c49270ddc93b4d639c0e7f77767c4fd47.tar.bz2 |
Merge 8.5. Bring together the compile time and run time Xkb checks.bug_3607830
Diffstat (limited to 'unix/tkUnixKey.c')
-rw-r--r-- | unix/tkUnixKey.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 27425ff..40cc779 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -17,7 +17,11 @@ ** does this and sets the USE_XKB flag if xkb is supported. ** (should this be function ptr?) */ -#include <X11/XKBlib.h> +#ifdef HAVE_XKBKEYCODETOKEYSYM +# include <X11/XKBlib.h> +#else +# define XkbKeycodeToKeysym(D,K,G,L) XKeycodeToKeysym(D,K,L) +#endif #define TkKeycodeToKeysym(D,K,G,L) \ ((D)->flags & TK_DISPLAY_USE_XKB) ? \ XkbKeycodeToKeysym((D)->display,K,G,L) : \ @@ -286,6 +290,15 @@ TkpGetKeySym( int index; TkKeyEvent* kePtr = (TkKeyEvent*) eventPtr; + /* + * Refresh the mapping information if it's stale. This must happen before + * we do any input method processing. [Bug 3599312] + */ + + if (dispPtr->bindInfoStale) { + TkpInitKeymapInfo(dispPtr); + } + #ifdef TK_USE_INPUT_METHODS /* * If input methods are active, we may already have determined a keysym. @@ -298,6 +311,7 @@ TkpGetKeySym( Tcl_DString ds; TkWindow *winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, eventPtr->xany.window); + Tcl_DStringInit(&ds); (void) TkpGetString(winPtr, eventPtr, &ds); Tcl_DStringFree(&ds); @@ -309,14 +323,6 @@ TkpGetKeySym( #endif /* - * Refresh the mapping information if it's stale - */ - - if (dispPtr->bindInfoStale) { - TkpInitKeymapInfo(dispPtr); - } - - /* * Figure out which of the four slots in the keymap vector to use for this * key. Refer to Xlib documentation for more info on how this computation * works. |