Mercurial > hg > index.fcgi > dwm > dwm-3.6.1-12pba
diff layout.c @ 1:ba504f41828f
add prev/next control to view_tags() and setlayouts()
author | paulo@localhost |
---|---|
date | Mon, 23 Mar 2009 00:14:48 -0700 |
parents | 7024076fa948 |
children | faa4cb9d7bd6 |
line diff
1.1 --- a/layout.c Sun Mar 22 23:26:35 2009 -0700 1.2 +++ b/layout.c Mon Mar 23 00:14:48 2009 -0700 1.3 @@ -427,14 +427,14 @@ 1.4 1.5 void 1.6 setlayout(Arg *arg) { 1.7 - unsigned int i; 1.8 + int i; 1.9 1.10 - if(arg->i == -1) { 1.11 + if(arg->i < 0) { 1.12 for(i = 0; i < nlayouts && lt != &layout[i]; i++); 1.13 - if(i == nlayouts - 1) 1.14 - lt = &layout[0]; 1.15 - else 1.16 - lt = &layout[++i]; 1.17 + if(arg->i == -1) 1.18 + lt = &layout[(i + 1) % nlayouts]; 1.19 + else if(arg->i == -2) 1.20 + lt = &layout[(i - 1) >= 0 ? i - 1 : nlayouts - 1]; 1.21 } 1.22 else { 1.23 if(arg->i < 0 || arg->i >= nlayouts)