applied Gottox' grabkey patch
authorAnselm R Garbe <garbeam@gmail.com>
Tue, 2 Sep 2008 17:47:01 +0000 (18:47 +0100)
committerAnselm R Garbe <garbeam@gmail.com>
Tue, 2 Sep 2008 17:47:01 +0000 (18:47 +0100)
dwm.c

diff --git a/dwm.c b/dwm.c
index 12871cd..bdef755 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -763,10 +763,10 @@ grabkeys(void) {
 
                XUngrabKey(dpy, AnyKey, AnyModifier, root);
                for(i = 0; i < LENGTH(keys); i++) {
-                       code = XKeysymToKeycode(dpy, keys[i].keysym);
-                       for(j = 0; j < LENGTH(modifiers); j++)
-                               XGrabKey(dpy, code, keys[i].mod | modifiers[j], root, True,
-                                        GrabModeAsync, GrabModeAsync);
+                       if((code = XKeysymToKeycode(dpy, keys[i].keysym)))
+                               for(j = 0; j < LENGTH(modifiers); j++)
+                                       XGrabKey(dpy, code, keys[i].mod | modifiers[j], root,
+                                                True, GrabModeAsync, GrabModeAsync);
                }
        }
 }