From 349d768b573c5b96056faf153273878f61a9f0c9 Mon Sep 17 00:00:00 2001 From: Anselm R Garbe Date: Sat, 17 May 2008 14:04:27 +0100 Subject: renamed setlayout into togglelayout --- dwm.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index 02c30d4..88391af 100644 --- a/dwm.c +++ b/dwm.c @@ -165,7 +165,6 @@ 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 +178,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 +335,7 @@ buttonpress(XEvent *e) { } } if((ev->x < x + blw) && ev->button == Button1) - setlayout(NULL); + togglelayout(NULL); } else if((c = getclient(ev->window))) { focus(c); @@ -1375,28 +1375,6 @@ setclientstate(Client *c, long state) { PropModeReplace, (unsigned char *)data, 2); } -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; @@ -1635,6 +1613,28 @@ togglefloating(const char *arg) { arrange(); } +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; -- cgit v1.2.3-13-gbd6f