--- a/dwm.c Thu May 15 10:51:37 2008 +0100
+++ b/dwm.c Sat May 17 14:04:27 2008 +0100
@@ -165,7 +165,6 @@
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 +178,7 @@
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 +335,7 @@
}
}
if((ev->x < x + blw) && ev->button == Button1)
- setlayout(NULL);
+ togglelayout(NULL);
}
else if((c = getclient(ev->window))) {
focus(c);
@@ -1376,28 +1376,6 @@
}
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;
@@ -1636,6 +1614,28 @@
}
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;