summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixKey.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-04-01 17:07:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-04-01 17:07:10 (GMT)
commit5a6fcb313c27b3145619f37e5d83b93586805a2e (patch)
tree64da754277b242dc50862f735d5b4ee523971fa6 /unix/tkUnixKey.c
parent9932e11bac14e2b538a97dbda667547a3e0b5dbc (diff)
parenta3be66c88fd7d5f2e2e9a475635bf0c5b407335b (diff)
downloadtk-5a6fcb313c27b3145619f37e5d83b93586805a2e.zip
tk-5a6fcb313c27b3145619f37e5d83b93586805a2e.tar.gz
tk-5a6fcb313c27b3145619f37e5d83b93586805a2e.tar.bz2
Merge 8.5. Bring together the compile time and run time Xkb checks.
Diffstat (limited to 'unix/tkUnixKey.c')
-rw-r--r--unix/tkUnixKey.c24
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.