JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Chris pointed me to the fact, that the window geoms calculation can be done once...
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index 020adb3..79a3a33 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();
@@ -1723,12 +1724,13 @@ tile(void) {
                for(n = 0, c = nexttiled(clients, i); c; c = nexttiled(c->next, i))
                        n++;
 
+               /* window geoms */
+               mw = (n == 1) ? m->waw : m->mwfact * m->waw;
+               th = (n > 1) ? m->wah / (n - 1) : 0;
+               if(n > 1 && th < bh)
+                       th = m->wah;
+
                for(j = 0, c = mc = nexttiled(clients, i); c; c = nexttiled(c->next, i)) {
-                       /* window geoms */
-                       mw = (n == 1) ? m->waw : m->mwfact * m->waw;
-                       th = (n > 1) ? m->wah / (n - 1) : 0;
-                       if(n > 1 && th < bh)
-                               th = m->wah;
                        if(j == 0) { /* master */
                                nx = m->wax;
                                ny = m->way;