JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
removed reapply() -- unnecessary
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index 009118d..6299b63 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -158,14 +158,12 @@ void movemouse(Client *c);
 Client *nexttiled(Client *c);
 void propertynotify(XEvent *e);
 void quit(const char *arg);
-void reapply(const char *arg);
 void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
 void resizemouse(Client *c);
 void restack(void);
 void run(void);
 void scan(void);
 void setclientstate(Client *c, long state);
-void setlayout(const char *arg);
 void setmfact(const char *arg);
 void setup(void);
 void spawn(const char *arg);
@@ -179,6 +177,7 @@ void tileresize(Client *c, int x, int y, int w, int h);
 void tilev(void);
 void tilevstack(unsigned int n);
 void togglefloating(const char *arg);
+void togglelayout(const char *arg);
 void toggletag(const char *arg);
 void toggleview(const char *arg);
 void unban(Client *c);
@@ -335,7 +334,7 @@ buttonpress(XEvent *e) {
                        }
                }
                if((ev->x < x + blw) && ev->button == Button1) 
-                       setlayout(NULL);
+                       togglelayout(NULL);
        }
        else if((c = getclient(ev->window))) {
                focus(c);
@@ -504,7 +503,7 @@ void
 detachstack(Client *c) {
        Client **tc;
 
-       for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
+       for(tc = &stack; *tc && *tc != c; tc = &(*tc)->snext);
        *tc = c->snext;
 }
 
@@ -1137,17 +1136,6 @@ quit(const char *arg) {
 }
 
 void
-reapply(const char *arg) {
-       Client *c;
-
-       for(c = clients; c; c = c->next) {
-               memset(c->tags, 0, TAGSZ);
-               applyrules(c);
-       }
-       arrange();
-}
-
-void
 resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
        XWindowChanges wc;
 
@@ -1162,8 +1150,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
 
                /* adjust for aspect limits */
                if(c->minax != c->maxax && c->minay != c->maxay 
-               && c->minax > 0 && c->maxax > 0 && c->minay > 0 && c->maxay > 0)
-               {
+               && c->minax > 0 && c->maxax > 0 && c->minay > 0 && c->maxay > 0) {
                        if(w * c->maxay > h * c->maxax)
                                w = h * c->maxax / c->maxay;
                        else if(w * c->minay < h * c->minax)
@@ -1377,28 +1364,6 @@ setclientstate(Client *c, long state) {
 }
 
 void
-setlayout(const char *arg) {
-       unsigned int i;
-
-       if(!arg) {
-               if(++lt == &layouts[LENGTH(layouts)])
-                       lt = &layouts[0];
-       }
-       else {
-               for(i = 0; i < LENGTH(layouts); i++)
-                       if(!strcmp(arg, layouts[i].symbol))
-                               break;
-               if(i == LENGTH(layouts))
-                       return;
-               lt = &layouts[i];
-       }
-       if(sel)
-               arrange();
-       else
-               drawbar();
-}
-
-void
 setmfact(const char *arg) {
        double d;
 
@@ -1532,7 +1497,7 @@ tag(const char *arg) {
        if(!sel)
                return;
        for(i = 0; i < LENGTH(tags); i++)
-               sel->tags[i] = (NULL == arg);
+               sel->tags[i] = (arg == NULL);
        sel->tags[idxoftag(arg)] = True;
        arrange();
 }
@@ -1637,6 +1602,28 @@ togglefloating(const char *arg) {
 }
 
 void
+togglelayout(const char *arg) {
+       unsigned int i;
+
+       if(!arg) {
+               if(++lt == &layouts[LENGTH(layouts)])
+                       lt = &layouts[0];
+       }
+       else {
+               for(i = 0; i < LENGTH(layouts); i++)
+                       if(!strcmp(arg, layouts[i].symbol))
+                               break;
+               if(i == LENGTH(layouts))
+                       return;
+               lt = &layouts[i];
+       }
+       if(sel)
+               arrange();
+       else
+               drawbar();
+}
+
+void
 toggletag(const char *arg) {
        unsigned int i, j;