diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 18:33:15 +0100 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 18:33:15 +0100 |
commit | 879241c05cbf959304a2dc4f2fabcdcecaea5092 (patch) | |
tree | 824a9185087d91eff6021c646c2372033e4f9f56 /screen.c | |
parent | 3794c6294535518fdcdf2ceb434875584189aa1e (diff) | |
download | dwm-879241c05cbf959304a2dc4f2fabcdcecaea5092.tar.gz |
replaced togglelayout with setlayout
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/screen.c b/screen.c index 5907ba7..8abe3d7 100644 --- a/screen.c +++ b/screen.c @@ -191,6 +191,28 @@ restack(void) { } void +setlayout(Arg *arg) { + unsigned int i; + + if(arg->i == -1) { + for(i = 0; i < nlayouts && lt != &layout[i]; i++); + if(i == nlayouts - 1) + lt = &layout[0]; + else + lt = &layout[++i]; + } + else { + if(arg->i < 0 || arg->i >= nlayouts) + return; + lt = &layout[arg->i]; + } + if(sel) + lt->arrange(); + else + drawstatus(); +} + +void settags(Client *c, Client *trans) { char prop[512]; unsigned int i, j; @@ -253,21 +275,6 @@ toggletag(Arg *arg) { } void -togglelayout(Arg *arg) { - unsigned int i; - - for(i = 0; i < nlayouts && lt != &layout[i]; i++); - if(i == nlayouts - 1) - lt = &layout[0]; - else - lt = &layout[++i]; - if(sel) - lt->arrange(); - else - drawstatus(); -} - -void toggleversatile(Arg *arg) { if(!sel || lt->arrange == versatile) return; |