From 879241c05cbf959304a2dc4f2fabcdcecaea5092 Mon Sep 17 00:00:00 2001 From: Anselm R. Garbe Date: Mon, 19 Feb 2007 18:33:15 +0100 Subject: replaced togglelayout with setlayout --- screen.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'screen.c') diff --git a/screen.c b/screen.c index 5907ba7..8abe3d7 100644 --- a/screen.c +++ b/screen.c @@ -190,6 +190,28 @@ restack(void) { while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } +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]; @@ -252,21 +274,6 @@ toggletag(Arg *arg) { lt->arrange(); } -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) -- cgit v1.2.3