diff options
Diffstat (limited to '')
| -rw-r--r-- | layout.c | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -10,7 +10,7 @@ typedef struct { | |||
| 10 | } Layout; | 10 | } Layout; |
| 11 | 11 | ||
| 12 | unsigned int blw = 0; | 12 | unsigned int blw = 0; |
| 13 | static unsigned int sellayout = 0; /* default */ | 13 | static unsigned int ltidx = 0; /* default */ |
| 14 | 14 | ||
| 15 | static void | 15 | static void |
| 16 | floating(void) { /* default floating layout */ | 16 | floating(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) { | |||
| 76 | const char * | 76 | const char * |
| 77 | getsymbol(void) | 77 | getsymbol(void) |
| 78 | { | 78 | { |
| 79 | return layouts[sellayout].symbol; | 79 | return layouts[ltidx].symbol; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | Bool | 82 | Bool |
| 83 | isfloating(void) { | 83 | isfloating(void) { |
| 84 | return layouts[sellayout].arrange == floating; | 84 | return layouts[ltidx].arrange == floating; |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | Bool | 87 | Bool |
| 88 | isarrange(void (*func)()) | 88 | isarrange(void (*func)()) |
| 89 | { | 89 | { |
| 90 | return func == layouts[sellayout].arrange; | 90 | return func == layouts[ltidx].arrange; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | void | 93 | void |
| 94 | initlayouts(void) { | 94 | initlayouts(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(); |
