>From 412715ff3ceb07e8014ec66dca77b506c79c101d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sun, 15 Jul 2012 10:54:44 +0200
Subject: [PATCH] WPrefs: XKeycodeToKeysym deprecated function
The function XKeycodeToKeysym is deprecated and should be replaced
by XkbKeycodeToKeysym.
---
WPrefs.app/KeyboardShortcuts.c | 3 ++-
WPrefs.app/MouseSettings.c | 3 ++-
WPrefs.app/xmodifier.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c
index 5718653..00c5e3e 100644
--- a/WPrefs.app/KeyboardShortcuts.c
+++ b/WPrefs.app/KeyboardShortcuts.c
@@ -25,6 +25,7 @@
#include <ctype.h>
#include <X11/keysym.h>
+#include <X11/XKBlib.h>
typedef struct _Panel {
WMBox *box;
@@ -242,7 +243,7 @@ char *capture_shortcut(Display *dpy, Bool *capturing, Bool
convert_case)
XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
WMNextEvent(dpy, &ev);
if (ev.type == KeyPress && ev.xkey.keycode != 0) {
- ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0);
+ ksym = XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, 0);
if (!IsModifierKey(ksym)) {
if (convert_case) {
XConvertCase(ksym, &lksym, &uksym);
diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c
index b1ed9fc..ca709e5 100644
--- a/WPrefs.app/MouseSettings.c
+++ b/WPrefs.app/MouseSettings.c
@@ -23,6 +23,7 @@
#include "WPrefs.h"
#include <X11/Xutil.h>
+#include <X11/XKBlib.h>
#include <unistd.h>
#include <math.h>
@@ -361,7 +362,7 @@ static void fillModifierPopUp(WMPopUpButton * pop)
if (mapping->modifiermap[idx] != 0) {
int l;
for (l = 0; l < 4; l++) {
- ksym = XKeycodeToKeysym(dpy,
mapping->modifiermap[idx], l);
+ ksym = XkbKeycodeToKeysym(dpy,
mapping->modifiermap[idx], 0, l);
if (ksym != NoSymbol)
break;
}
diff --git a/WPrefs.app/xmodifier.c b/WPrefs.app/xmodifier.c
index 35046f2..9732606 100644
--- a/WPrefs.app/xmodifier.c
+++ b/WPrefs.app/xmodifier.c
@@ -35,6 +35,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>
@@ -159,7 +160,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.4
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From 412715ff3ceb07e8014ec66dca77b506c79c101d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sun, 15 Jul 2012 10:54:44 +0200
Subject: [PATCH] WPrefs: XKeycodeToKeysym deprecated function
The function XKeycodeToKeysym is deprecated and should be replaced
by XkbKeycodeToKeysym.
---
WPrefs.app/KeyboardShortcuts.c | 3 ++-
WPrefs.app/MouseSettings.c | 3 ++-
WPrefs.app/xmodifier.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c
index 5718653..00c5e3e 100644
--- a/WPrefs.app/KeyboardShortcuts.c
+++ b/WPrefs.app/KeyboardShortcuts.c
@@ -25,6 +25,7 @@
#include <ctype.h>
#include <X11/keysym.h>
+#include <X11/XKBlib.h>
typedef struct _Panel {
WMBox *box;
@@ -242,7 +243,7 @@ char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
WMNextEvent(dpy, &ev);
if (ev.type == KeyPress && ev.xkey.keycode != 0) {
- ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0);
+ ksym = XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, 0);
if (!IsModifierKey(ksym)) {
if (convert_case) {
XConvertCase(ksym, &lksym, &uksym);
diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c
index b1ed9fc..ca709e5 100644
--- a/WPrefs.app/MouseSettings.c
+++ b/WPrefs.app/MouseSettings.c
@@ -23,6 +23,7 @@
#include "WPrefs.h"
#include <X11/Xutil.h>
+#include <X11/XKBlib.h>
#include <unistd.h>
#include <math.h>
@@ -361,7 +362,7 @@ static void fillModifierPopUp(WMPopUpButton * pop)
if (mapping->modifiermap[idx] != 0) {
int l;
for (l = 0; l < 4; l++) {
- ksym = XKeycodeToKeysym(dpy, mapping->modifiermap[idx], l);
+ ksym = XkbKeycodeToKeysym(dpy, mapping->modifiermap[idx], 0, l);
if (ksym != NoSymbol)
break;
}
diff --git a/WPrefs.app/xmodifier.c b/WPrefs.app/xmodifier.c
index 35046f2..9732606 100644
--- a/WPrefs.app/xmodifier.c
+++ b/WPrefs.app/xmodifier.c
@@ -35,6 +35,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>
@@ -159,7 +160,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.4