JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
applied sanders max size fix
[dwm.git] / view.c
diff --git a/view.c b/view.c
index 24b0349..facbb4c 100644 (file)
--- a/view.c
+++ b/view.c
@@ -44,6 +44,10 @@ reorder(void) {
 static void
 togglemax(Client *c) {
        XEvent ev;
+               
+       if (x->maxw && x->minw && x->maxh && x->minh &&
+                       x->maxw == x->minw && x->maxh == x->minh)
+               return;
 
        if((c->ismax = !c->ismax)) {
                c->rx = c->x; c->x = sx;
@@ -63,7 +67,7 @@ togglemax(Client *c) {
 
 /* extern */
 
-void (*arrange)(Arg *) = DEFMODE;
+void (*arrange)(void) = DEFMODE;
 
 void
 detach(Client *c) {
@@ -77,7 +81,7 @@ detach(Client *c) {
 }
 
 void
-dofloat(Arg *arg) {
+dofloat(void) {
        Client *c;
 
        for(c = clients; c; c = c->next) {
@@ -95,7 +99,7 @@ dofloat(Arg *arg) {
 }
 
 void
-dotile(Arg *arg) {
+dotile(void) {
        unsigned int i, n, mpx, stackw, stackh, th;
        Client *c;
 
@@ -108,7 +112,7 @@ dotile(Arg *arg) {
        if(n > 1)
                th /= (n - 1);
 
-       for(i = 0, c = clients; c; c = c->next, i++)
+       for(i = 0, c = clients; c; c = c->next)
                if(isvisible(c)) {
                        if(c->isfloat) {
                                resize(c, True, TopLeft);
@@ -139,6 +143,7 @@ dotile(Arg *arg) {
                                        c->h = stackh - 2 * BORDERPX;
                        }
                        resize(c, False, TopLeft);
+                       i++;
                }
                else
                        ban(c);
@@ -210,7 +215,7 @@ resizecol(Arg *arg) {
                        return;
                master -= arg->i;
        }
-       arrange(NULL);
+       arrange();
 }
 
 void
@@ -247,7 +252,7 @@ void
 togglemode(Arg *arg) {
        arrange = (arrange == dofloat) ? dotile : dofloat;
        if(sel)
-               arrange(NULL);
+               arrange();
        else
                drawstatus();
 }
@@ -261,7 +266,7 @@ toggleview(Arg *arg) {
        if(i == ntags)
                seltag[arg->i] = True; /* cannot toggle last view */
        reorder();
-       arrange(NULL);
+       arrange();
 }
 
 void
@@ -272,7 +277,7 @@ view(Arg *arg) {
                seltag[i] = False;
        seltag[arg->i] = True;
        reorder();
-       arrange(NULL);
+       arrange();
 }
 
 void
@@ -282,7 +287,7 @@ viewall(Arg *arg) {
        for(i = 0; i < ntags; i++)
                seltag[i] = True;
        reorder();
-       arrange(NULL);
+       arrange();
 }
 
 void
@@ -310,5 +315,5 @@ zoom(Arg *arg) {
        c->next = clients;
        clients = c;
        focus(c);
-       arrange(NULL);
+       arrange();
 }