[dev] [PATCHv2] dwm: replace deprecated XKeycodeToKeysym

2012-12-11 Thread Antonio Quartulli
XKeycodeToKeysym is now deprecated in favour of XkbKeycodeToKeysym
(X11/XKBlib.h). This patch substitutes the former with  the
latter in dwm.c

Signed-off-by: Antonio Quartulli or...@autistici.org
---
 dwm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dwm.c b/dwm.c
index d9443da..5d497b0 100644
--- a/dwm.c
+++ b/dwm.c
@@ -33,6 +33,7 @@
 #include X11/cursorfont.h
 #include X11/keysym.h
 #include X11/Xatom.h
+#include X11/XKBlib.h
 #include X11/Xlib.h
 #include X11/Xproto.h
 #include X11/Xutil.h
@@ -1080,7 +1081,7 @@ keypress(XEvent *e) {
XKeyEvent *ev;
 
ev = e-xkey;
-   keysym = XKeycodeToKeysym(dpy, (KeyCode)ev-keycode, 0);
+   keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev-keycode, 0, 0);
for(i = 0; i  LENGTH(keys); i++)
if(keysym == keys[i].keysym
 CLEANMASK(keys[i].mod) == CLEANMASK(ev-state)
-- 
1.8.0




Re: [dev] [PATCHv2] dwm: replace deprecated XKeycodeToKeysym

2012-12-11 Thread Anselm R Garbe
Please see the other mail. This patch won't make it into dwm, as this
doesn't work in several X server setups and we don't want to introduce
case-handling as long as the modern X servers still support the old
behavior.

Best regards,
Anselm

On 11 December 2012 10:25, Antonio Quartulli or...@autistici.org wrote:
 XKeycodeToKeysym is now deprecated in favour of XkbKeycodeToKeysym
 (X11/XKBlib.h). This patch substitutes the former with  the
 latter in dwm.c

 Signed-off-by: Antonio Quartulli or...@autistici.org
 ---
  dwm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/dwm.c b/dwm.c
 index d9443da..5d497b0 100644
 --- a/dwm.c
 +++ b/dwm.c
 @@ -33,6 +33,7 @@
  #include X11/cursorfont.h
  #include X11/keysym.h
  #include X11/Xatom.h
 +#include X11/XKBlib.h
  #include X11/Xlib.h
  #include X11/Xproto.h
  #include X11/Xutil.h
 @@ -1080,7 +1081,7 @@ keypress(XEvent *e) {
 XKeyEvent *ev;

 ev = e-xkey;
 -   keysym = XKeycodeToKeysym(dpy, (KeyCode)ev-keycode, 0);
 +   keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev-keycode, 0, 0);
 for(i = 0; i  LENGTH(keys); i++)
 if(keysym == keys[i].keysym
  CLEANMASK(keys[i].mod) == CLEANMASK(ev-state)
 --
 1.8.0





Re: [dev] [PATCHv2] dwm: replace deprecated XKeycodeToKeysym

2012-12-11 Thread Antonio Quartulli
On Tue, Dec 11, 2012 at 06:55:47PM +0100, Anselm R Garbe wrote:
 Please see the other mail. This patch won't make it into dwm, as this
 doesn't work in several X server setups and we don't want to introduce
 case-handling as long as the modern X servers still support the old
 behavior.

Yap, I have read that.
Oky, sounds good!

Thank you!

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto Che Guevara


pgp7Bb49JHAqG.pgp
Description: PGP signature