JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fixed missing else branch
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index 699aed1..48e0dd1 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -374,7 +374,8 @@ buttonpress(XEvent *e) {
                else if(ev->button == Button2) {
                        if((floating != m->layout->arrange) && c->isfloating)
                                togglefloating(NULL);
-                       zoom(NULL);
+                       else
+                               zoom(NULL);
                }
                else if(ev->button == Button3 && !c->isfixed) {
                        restack();
@@ -1976,14 +1977,17 @@ xerrorstart(Display *dsply, XErrorEvent *ee) {
 void
 view(const char *arg) {
        unsigned int i;
-
+       Bool tmp[LENGTH(tags)];
        Monitor *m = &monitors[monitorat()];
 
-       memcpy(m->prevtags, m->seltags, sizeof initags);
        for(i = 0; i < LENGTH(tags); i++)
-               m->seltags[i] = (NULL == arg);
-       m->seltags[idxoftag(arg)] = True;
-       arrange();
+               tmp[i] = (NULL == arg);
+       tmp[idxoftag(arg)] = True;
+       if(memcmp(m->seltags, tmp, sizeof initags) != 0) {
+               memcpy(m->prevtags, m->seltags, sizeof initags);
+               memcpy(m->seltags, tmp, sizeof initags);
+               arrange();
+       }
 }
 
 void