summaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-08-18 13:48:05 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-08-18 13:48:05 +0200
commit50be6c8b67c500ee4aa07919609fa80785fd389d (patch)
treeb6cb11170b9273e079a536e6a70c6d8d5bcb7e98 /layout.c
parentapplied Gottox mwfact patch (diff)
downloaddwm-50be6c8b67c500ee4aa07919609fa80785fd389d.tar.gz
dwm-50be6c8b67c500ee4aa07919609fa80785fd389d.zip
cleaned up settags-handling
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/layout.c b/layout.c
index 573de57..030c282 100644
--- a/layout.c
+++ b/layout.c
@@ -10,7 +10,7 @@ typedef struct {
10} Layout; 10} Layout;
11 11
12unsigned int blw = 0; 12unsigned int blw = 0;
13static unsigned int sellayout = 0; /* default */ 13static unsigned int ltidx = 0; /* default */
14 14
15static void 15static void
16floating(void) { /* default floating layout */ 16floating(void) { /* default floating layout */
@@ -36,7 +36,7 @@ arrange(void) {
36 unban(c); 36 unban(c);
37 else 37 else
38 ban(c); 38 ban(c);
39 layouts[sellayout].arrange(); 39 layouts[ltidx].arrange();
40 focus(NULL); 40 focus(NULL);
41 restack(); 41 restack();
42} 42}
@@ -76,25 +76,25 @@ focusprev(const char *arg) {
76const char * 76const char *
77getsymbol(void) 77getsymbol(void)
78{ 78{
79 return layouts[sellayout].symbol; 79 return layouts[ltidx].symbol;
80} 80}
81 81
82Bool 82Bool
83isfloating(void) { 83isfloating(void) {
84 return layouts[sellayout].arrange == floating; 84 return layouts[ltidx].arrange == floating;
85} 85}
86 86
87Bool 87Bool
88isarrange(void (*func)()) 88isarrange(void (*func)())
89{ 89{
90 return func == layouts[sellayout].arrange; 90 return func == layouts[ltidx].arrange;
91} 91}
92 92
93void 93void
94initlayouts(void) { 94initlayouts(void) {
95 unsigned int i, w; 95 unsigned int i, w;
96 96
97 /* TODO deserialize sellayout if present */ 97 /* TODO deserialize ltidx if present */
98 nlayouts = sizeof layouts / sizeof layouts[0]; 98 nlayouts = sizeof layouts / sizeof layouts[0];
99 for(blw = i = 0; i < nlayouts; i++) { 99 for(blw = i = 0; i < nlayouts; i++) {
100 w = textw(layouts[i].symbol); 100 w = textw(layouts[i].symbol);
@@ -143,14 +143,14 @@ setlayout(const char *arg) {
143 int i; 143 int i;
144 144
145 if(!arg) { 145 if(!arg) {
146 if(++sellayout == nlayouts) 146 if(++ltidx == nlayouts)
147 sellayout = 0;; 147 ltidx = 0;;
148 } 148 }
149 else { 149 else {
150 i = atoi(arg); 150 i = atoi(arg);
151 if(i < 0 || i >= nlayouts) 151 if(i < 0 || i >= nlayouts)
152 return; 152 return;
153 sellayout = i; 153 ltidx = i;
154 } 154 }
155 if(sel) 155 if(sel)
156 arrange(); 156 arrange();