[hackers] [dwm] applied Neil Klopfstein's patch, slightly modified || anselm
changeset: 1608:bb7e1fb88f18
tag: tip
user: anselm_AT_garbe.us
date: Sat Nov 17 19:10:39 2012 +0100
files: dwm.c
description:
applied Neil Klopfstein's patch, slightly modified
diff -r 5d388d9ee2e8 -r bb7e1fb88f18 dwm.c
--- a/dwm.c Sat Nov 17 19:01:22 2012 +0100
+++ b/dwm.c Sat Nov 17 19:10:39 2012 +0100
_AT_@ -282,7 +282,7 @@
[UnmapNotify] = unmapnotify
};
static Atom wmatom[WMLast], netatom[NetLast];
-static Bool running = True;
+static Bool running = True, usexkb;
static Cursor cursor[CurLast];
static Display *dpy;
static DC dc;
_AT_@ -1069,7 +1069,10 @@
XKeyEvent *ev;
ev = &e->xkey;
- keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0);
+ if(usexkb) {
+ keysym = XkbKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0, 0);
+ else
+ keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
for(i = 0; i < LENGTH(keys); i++)
if(keysym == keys[i].keysym
&& CLEANMASK(keys[i].mod) == CLEANMASK(ev->state)
_AT_@ -1579,6 +1582,7 @@
void
setup(void) {
XSetWindowAttributes wa;
+ int dummy = 0, xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion;
/* clean up any zombies immediately */
sigchld(0);
_AT_@ -1631,6 +1635,8 @@
|EnterWindowMask|LeaveWindowMask|StructureNotifyMask|PropertyChangeMask;
XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
XSelectInput(dpy, root, wa.event_mask);
+ /* init xkb */
+ usexkb = XkbQueryExtension(dpy, &dummy, &dummy, &dummy, &xkb_major, &xkb_minor);
grabkeys();
}
Received on Sat Nov 17 2012 - 19:10:29 CET
This archive was generated by hypermail 2.3.0
: Sat Nov 17 2012 - 19:12:18 CET