JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
applied fix of toggletag by Jan Kaliszewski
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index 9c0ebcf..ec87228 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -1128,7 +1128,7 @@ resizemouse(const Arg *arg) {
                return;
        XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
        do {
-               XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask , &ev);
+               XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
                switch(ev.type) {
                case ConfigureRequest:
                case Expose:
@@ -1469,8 +1469,12 @@ togglefloating(const Arg *arg) {
 
 void
 toggletag(const Arg *arg) {
-       unsigned int mask = sel->tags ^ (arg->ui & TAGMASK);
+       unsigned int mask;
 
+       if (!sel)
+               return;
+       
+       mask = sel->tags ^ (arg->ui & TAGMASK);
        if(sel && mask) {
                sel->tags = mask;
                arrange();