summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-02-23 15:12:17 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-02-23 15:12:17 (GMT)
commitda8764ce8dc25d831e182604c8f148247406cabd (patch)
tree7671b56e5970887baf6d349ed2b98d4eac0bb59c
parentc93120c9140ebe973dd98b9ac31b2051830871c8 (diff)
downloadtk-da8764ce8dc25d831e182604c8f148247406cabd.zip
tk-da8764ce8dc25d831e182604c8f148247406cabd.tar.gz
tk-da8764ce8dc25d831e182604c8f148247406cabd.tar.bz2
Remove detection of Xkb performed at runtime, which removes the deprecation warning about XKeyCodeToKeysym. See ticket [3551802fff].
-rw-r--r--generic/tkInt.h1
-rw-r--r--unix/tkUnixEvent.c5
-rw-r--r--unix/tkUnixKey.c21
3 files changed, 7 insertions, 20 deletions
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 7ef7862..be88296 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -571,7 +571,6 @@ typedef struct TkDisplay {
#define TK_DISPLAY_USE_IM (1 << 1)
#define TK_DISPLAY_WM_TRACING (1 << 3)
#define TK_DISPLAY_IN_WARP (1 << 4)
-#define TK_DISPLAY_USE_XKB (1 << 5)
/*
* One of the following structures exists for each error handler created by a
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 1e9a98f..2e2b41b 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -129,7 +129,6 @@ TkpOpenDisplay(
int major = 1;
int minor = 0;
int reason = 0;
- unsigned int use_xkb = 0;
/* Disabled, until we have a better test. See [Bug 3613668] */
#if 0 && defined(XKEYCODETOKEYSYM_IS_DEPRECATED)
static int xinited = 0;
@@ -154,7 +153,7 @@ TkpOpenDisplay(
/*
** Bug [3607830]: Before using Xkb, it must be initialized and confirmed
- ** that the serve supports it. The XkbOpenDisplay call
+ ** that the server supports it. The XkbOpenDisplay call
** will perform this check and return NULL if the extension
** is not supported.
**
@@ -168,7 +167,6 @@ TkpOpenDisplay(
event, error, major, minor, reason);*/
display = XOpenDisplay(displayNameStr);
} else {
- use_xkb = TK_DISPLAY_USE_XKB;
/*fprintf(stderr, "Using xkb %d.%d\n", major, minor);*/
}
@@ -178,7 +176,6 @@ TkpOpenDisplay(
dispPtr = ckalloc(sizeof(TkDisplay));
memset(dispPtr, 0, sizeof(TkDisplay));
dispPtr->display = display;
- dispPtr->flags |= use_xkb;
#ifdef TK_USE_INPUT_METHODS
OpenIM(dispPtr);
XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL,
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c
index 6681ad9..77db78e 100644
--- a/unix/tkUnixKey.c
+++ b/unix/tkUnixKey.c
@@ -12,20 +12,11 @@
#include "tkInt.h"
-/*
-** Bug [3607830]: Before using Xkb, it must be initialized. TkpOpenDisplay
-** does this and sets the USE_XKB flag if xkb is supported.
-** (should this be function ptr?)
-*/
#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) : \
- XKeycodeToKeysym((D)->display,K,L)
/*
* Prototypes for local functions defined in this file:
@@ -237,7 +228,7 @@ done:
/*
* When mapping from a keysym to a keycode, need information about the
- * modifier state to be used so that when they call TkKeycodeToKeysym taking
+ * modifier state to be used so that when they call XbkKeycodeToKeysym taking
* into account the xkey.state, they will get back the original keysym.
*/
@@ -363,7 +354,7 @@ TkpGetKeySym(
&& (eventPtr->xkey.state & LockMask))) {
index += 1;
}
- sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0,
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, 0,
index);
/*
@@ -378,7 +369,7 @@ TkpGetKeySym(
|| ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
|| ((sym >= XK_Ooblique) && (sym <= XK_Thorn)))) {
index &= ~1;
- sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode,
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
0, index);
}
}
@@ -389,7 +380,7 @@ TkpGetKeySym(
*/
if ((index & 1) && (sym == NoSymbol)) {
- sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode,
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
0, index & ~1);
}
return sym;
@@ -439,7 +430,7 @@ TkpInitKeymapInfo(
if (*codePtr == 0) {
continue;
}
- keysym = TkKeycodeToKeysym(dispPtr, *codePtr, 0, 0);
+ keysym = XkbKeycodeToKeysym(dispPtr->display, *codePtr, 0, 0);
if (keysym == XK_Shift_Lock) {
dispPtr->lockUsage = LU_SHIFT;
break;
@@ -465,7 +456,7 @@ TkpInitKeymapInfo(
if (*codePtr == 0) {
continue;
}
- keysym = TkKeycodeToKeysym(dispPtr, *codePtr, 0, 0);
+ keysym = XkbKeycodeToKeysym(dispPtr->display, *codePtr, 0, 0);
if (keysym == XK_Mode_switch) {
dispPtr->modeModMask |= ShiftMask << (i/modMapPtr->max_keypermod);
}