Here is the patch. To me it looks like these changes have been
introduced in the first 2.6.5 Debian package.

Bye,

Hendrik

This email and any attachments thereto may contain private, confidential, 
and/or privileged material for the sole use of the intended recipient. Any 
review, copying, or distribution of this email (or any attachments thereto) by 
others is strictly prohibited. If you are not the intended recipient, please 
contact the sender immediately and permanently delete the original and any 
copies of this email and any attachments thereto.
>From 06234f650ab35da27489ed71fee67d024391f80d Mon Sep 17 00:00:00 2001
From: tadam <tadam>
Subject: [PATCH] Provide fvwm_KeycodeToKeysym() to handle XKeycodeToKeysym()
 deprecation

X are deprecating XKeycodeToKeysym() in favour of XkbKeycodeToKeysym() --
however, older XServers will obviously not have access to XKB, so we have to
conditionally use the newer method only when it's available.

Origin: backport, https://github.com/ThomasAdam/fvwm/commit/06234f650ab35da27489ed71fee67d024391f80d.patch
Last-Update: 2013-02-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 
diff --git a/configure.ac b/configure.ac
index 9588bbb..9f6db24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -537,7 +537,11 @@ if test ! x"$with_shm" = xno; then
                [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
 fi
 
-# ********* xinerama
+# Silently look for X11/XKBlib.h
+AH_TEMPLATE([HAVE_X11_XKBLIB_H],[Define if Xkb extension is used.])
+AC_CHECK_HEADER(X11/XKBlib.h, AC_DEFINE(HAVE_X11_XKBLIB_H))
+
+# ********* xineramA
 problem_xinerama=""
 
 AC_ARG_ENABLE(xinerama,
@@ -1657,6 +1661,14 @@ AH_VERBATIM([_ZEND_EXPLICIT_DEFINITIONS],
 #define fvwm_lstat(x,y) -1
 #endif
 
+#ifdef HAVE_X11_XKBLIB_H
+#include <X11/XKBlib.h>
+#define fvwm_KeycodeToKeysym(d, k, g, l) \
+	(XkbKeycodeToKeysym((d), (k), (g), (l)))
+#else
+#define fvwm_KeycodeToKeysym(d, k, x, i) (XKeycodeToKeysym((d), (k), (i)))
+#endif
+
 ])
 
 # mainly for fvwm-config
diff --git a/fvwm/builtins.c b/fvwm/builtins.c
index 8cb39e5..199a323 100644
--- a/fvwm/builtins.c
+++ b/fvwm/builtins.c
@@ -3853,7 +3853,7 @@ static Bool FKeysymToKeycode (Display *dpy, KeySym keysym,
 
 	for (m = 0; m <= 8; ++m)
 	{
-		KeySym ks = XKeycodeToKeysym(dpy, *keycode, m);
+		KeySym ks = fvwm_KeycodeToKeysym(dpy, *keycode, 0, m);
 		if (ks == keysym)
 		{
 			switch (m)
diff --git a/fvwm/events.c b/fvwm/events.c
index e6a1a74..cd25caf 100644
--- a/fvwm/events.c
+++ b/fvwm/events.c
@@ -2508,7 +2508,7 @@ void __handle_key(const evh_args_t *ea, Bool is_press)
 	/* Here's a real hack - some systems have two keys with the
 	 * same keysym and different keycodes. This converts all
 	 * the cases to one keycode. */
-	kc = XKeysymToKeycode(dpy, XKeycodeToKeysym(dpy, te->xkey.keycode, 0));
+	kc = XKeysymToKeycode(dpy, fvwm_KeycodeToKeysym(dpy, te->xkey.keycode, 0, 0));
 
 	/* Check if there is something bound to the key */
 
diff --git a/libs/Bindings.c b/libs/Bindings.c
index f024659..d7f76e6 100644
--- a/libs/Bindings.c
+++ b/libs/Bindings.c
@@ -181,7 +181,7 @@ int AddBinding(
 		{
 			if (BIND_IS_MOUSE_BINDING(type) ||
 			    STROKE_CODE(BIND_IS_STROKE_BINDING(type) ||)
-			    (tkeysym = XKeycodeToKeysym(dpy, i, m)) == keysym)
+			    (tkeysym = fvwm_KeycodeToKeysym(dpy, i, 0, m)) == keysym)
 			{
 				unsigned int add_modifiers = 0;
 				unsigned int bind_mask = 1;
diff --git a/modules/FvwmIconBox/FvwmIconBox.c b/modules/FvwmIconBox/FvwmIconBox.c
index ef8c237..700cae0 100644
--- a/modules/FvwmIconBox/FvwmIconBox.c
+++ b/modules/FvwmIconBox/FvwmIconBox.c
@@ -2445,7 +2445,7 @@ void parsekey(char *tline)
 
   XDisplayKeycodes(dpy, &kmin, &kmax);
   for (i=kmin; i<=kmax; i++)
-    if (XKeycodeToKeysym(dpy, i, 0) == keysym)
+    if (fvwm_KeycodeToKeysym(dpy, i, 0, 0) == keysym)
       {
 	k = (struct keyfunc *)safemalloc(sizeof(struct keyfunc));
 	memset(k, 0, sizeof(struct keyfunc));
@@ -3421,7 +3421,7 @@ void ExecuteKey(XEvent event)
 
   tmp = KeyActions;
   event.xkey.keycode =
-    XKeysymToKeycode(dpy,XKeycodeToKeysym(dpy,event.xkey.keycode,0));
+    XKeysymToKeycode(dpy,fvwm_KeycodeToKeysym(dpy,event.xkey.keycode,0,0));
   while (tmp != NULL){
     if (tmp->keycode == event.xkey.keycode){
       MySendFvwmPipe(fd, tmp->action, item->id);
diff --git a/modules/FvwmIconMan/readconfig.c b/modules/FvwmIconMan/readconfig.c
index e6ddd79..2bf6cda 100644
--- a/modules/FvwmIconMan/readconfig.c
+++ b/modules/FvwmIconMan/readconfig.c
@@ -753,7 +753,7 @@ static Binding *ParseKeyEntry(char *tline)
 
   XDisplayKeycodes(theDisplay, &min, &max);
   for (i=min; i<=max; i++) {
-    if (XKeycodeToKeysym(theDisplay, i, 0) == keysym) {
+    if (fvwm_KeycodeToKeysym(theDisplay, i, 0, 0) == keysym) {
       if (!func) {
 	func = parse_function_list(action);
 	if (!func) {
diff --git a/modules/FvwmIconMan/x.c b/modules/FvwmIconMan/x.c
index 97a8a43..4c98375 100644
--- a/modules/FvwmIconMan/x.c
+++ b/modules/FvwmIconMan/x.c
@@ -245,8 +245,8 @@ void xevent_loop (void)
        * the cases to one keycode. */
       theEvent.xkey.keycode =
 	XKeysymToKeycode (theDisplay,
-			  XKeycodeToKeysym(theDisplay,
-					   theEvent.xkey.keycode,0));
+			  fvwm_KeycodeToKeysym(theDisplay,
+					   theEvent.xkey.keycode,0,0));
       modifier = (theEvent.xkey.state & MODS_USED);
       ConsoleDebug (X11, "\tKeyPress: %d\n", theEvent.xkey.keycode);
 
diff --git a/modules/FvwmScript/FvwmScript.c b/modules/FvwmScript/FvwmScript.c
index f21468f..3d645ba 100644
--- a/modules/FvwmScript/FvwmScript.c
+++ b/modules/FvwmScript/FvwmScript.c
@@ -973,7 +973,7 @@ void ReadXServer (void)
       find = False;
       XLookupString(&event.xkey, (char *)buf, sizeof(buf), &ks, NULL);
       event.xkey.keycode =
-	XKeysymToKeycode(dpy,XKeycodeToKeysym(dpy,event.xkey.keycode,0));
+	XKeysymToKeycode(dpy,fvwm_KeycodeToKeysym(dpy,event.xkey.keycode,0,0));
 
       /* check for bindings defined by the Key instruction */
 	  tmp.res_class = tmp.res_name = "root";
@@ -1452,7 +1452,7 @@ int main (int argc, char **argv)
   /* Compute the Shift-Tab keysym */
   {
     KeyCode tab = XKeysymToKeycode(dpy, XK_Tab);
-    shift_tab_ks = XKeycodeToKeysym(dpy, tab, ShiftMask);
+    shift_tab_ks = fvwm_KeycodeToKeysym(dpy, tab, 0, ShiftMask);
   }
 
   /* Construction des boutons et de la fenetre */

Reply via email to