diff options
author | dgp <dgp@noemail.net> | 2013-04-01 17:07:10 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2013-04-01 17:07:10 (GMT) |
commit | 803c3bb89860092d4218ad57fef5b81a53a616a2 (patch) | |
tree | 64da754277b242dc50862f735d5b4ee523971fa6 /unix/tkUnixKey.c | |
parent | ee1e88701fe489d5b1b8cdd8aa4b95c49c99a5c3 (diff) | |
parent | 3209f1c998b8b629d65b3102c8da9a581661b199 (diff) | |
download | tk-803c3bb89860092d4218ad57fef5b81a53a616a2.zip tk-803c3bb89860092d4218ad57fef5b81a53a616a2.tar.gz tk-803c3bb89860092d4218ad57fef5b81a53a616a2.tar.bz2 |
Merge 8.5. Bring together the compile time and run time Xkb checks.
FossilOrigin-Name: e8eed9314495073acb5ab1d6df6e70ada80f4a0c
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. |