>From 731ddae64a35e3bebce94c6d6bfb701b630df017 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sun, 24 Jun 2012 11:11:46 +0200
Subject: [PATCH 2/3] XKeycodeToKeysym deprecated function

The function XKeycodeToKeysym is deprecated and should be replaced
by XkbKeycodeToKeysym.
---
 src/winmenu.c   |    3 ++-
 src/xmodifier.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/winmenu.c b/src/winmenu.c
index c967164..4e2b64f 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -28,6 +28,7 @@
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#include <X11/XKBlib.h>
 
 #include "WindowMaker.h"
 #include "actions.h"
@@ -246,7 +247,7 @@ static void updateWorkspaceMenu(WMenu * menu)
 static char *getShortcutString(WShortKey key)
 {
        char *tmp = NULL;
-       char *k = XKeysymToString(XKeycodeToKeysym(dpy, key.keycode, 0));
+       char *k = XKeysymToString(XkbKeycodeToKeysym(dpy, key.keycode, 0, 0));
        if (!k) return NULL;
 
        char **m = wPreferences.modifier_labels;
diff --git a/src/xmodifier.c b/src/xmodifier.c
index 7bae013..7642443 100644
--- a/src/xmodifier.c
+++ b/src/xmodifier.c
@@ -33,6 +33,7 @@ Perpetrator: Sudish Joseph <[email protected]>, Sept. 
1997. */
 #include <strings.h>
 #include <X11/Xlib.h>
 #include <X11/keysym.h>
+#include <X11/XKBlib.h>
 
 #include <WINGs/WUtil.h>
 #include "xmodifier.h"
@@ -160,7 +161,7 @@ static void x_reset_modifier_mapping(Display * display)
                        for (column = 0; column < 4; column += 2) {
                                KeyCode code = 
x_modifier_keymap->modifiermap[modifier_index * mkpm
                                                                              + 
modifier_key];
-                               KeySym sym = (code ? XKeycodeToKeysym(display, 
code, column) : 0);
+                               KeySym sym = (code ? 
XkbKeycodeToKeysym(display, code, 0, column) : 0);
                                if (sym == last_sym)
                                        continue;
                                last_sym = sym;
-- 
1.7.10

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From 731ddae64a35e3bebce94c6d6bfb701b630df017 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sun, 24 Jun 2012 11:11:46 +0200
Subject: [PATCH 2/3] XKeycodeToKeysym deprecated function

The function XKeycodeToKeysym is deprecated and should be replaced
by XkbKeycodeToKeysym.
---
 src/winmenu.c   |    3 ++-
 src/xmodifier.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/winmenu.c b/src/winmenu.c
index c967164..4e2b64f 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -28,6 +28,7 @@
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#include <X11/XKBlib.h>
 
 #include "WindowMaker.h"
 #include "actions.h"
@@ -246,7 +247,7 @@ static void updateWorkspaceMenu(WMenu * menu)
 static char *getShortcutString(WShortKey key)
 {
 	char *tmp = NULL;
-	char *k = XKeysymToString(XKeycodeToKeysym(dpy, key.keycode, 0));
+	char *k = XKeysymToString(XkbKeycodeToKeysym(dpy, key.keycode, 0, 0));
 	if (!k) return NULL;
 
 	char **m = wPreferences.modifier_labels;
diff --git a/src/xmodifier.c b/src/xmodifier.c
index 7bae013..7642443 100644
--- a/src/xmodifier.c
+++ b/src/xmodifier.c
@@ -33,6 +33,7 @@ Perpetrator: Sudish Joseph <[email protected]>, Sept. 1997. */
 #include <strings.h>
 #include <X11/Xlib.h>
 #include <X11/keysym.h>
+#include <X11/XKBlib.h>
 
 #include <WINGs/WUtil.h>
 #include "xmodifier.h"
@@ -160,7 +161,7 @@ static void x_reset_modifier_mapping(Display * display)
 			for (column = 0; column < 4; column += 2) {
 				KeyCode code = x_modifier_keymap->modifiermap[modifier_index * mkpm
 									      + modifier_key];
-				KeySym sym = (code ? XKeycodeToKeysym(display, code, column) : 0);
+				KeySym sym = (code ? XkbKeycodeToKeysym(display, code, 0, column) : 0);
 				if (sym == last_sym)
 					continue;
 				last_sym = sym;
-- 
1.7.10

Reply via email to