diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 12:15:48 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 12:15:48 +0100 |
| commit | 5711609203602bd01b4b131572142bb171ffc560 (patch) | |
| tree | aa0c27a21869acd9fa2696aedab6020024f812b7 | |
| parent | fixed some issues due to the Arg->const char * transition (diff) | |
| download | dwm-5711609203602bd01b4b131572142bb171ffc560.tar.gz dwm-5711609203602bd01b4b131572142bb171ffc560.zip | |
small bugfix
| -rw-r--r-- | layout.c | 18 | ||||
| -rw-r--r-- | tag.c | 6 |
2 files changed, 15 insertions, 9 deletions
| @@ -120,11 +120,17 @@ incmasterw(const char *arg) { | |||
| 120 | 120 | ||
| 121 | void | 121 | void |
| 122 | incnmaster(const char *arg) { | 122 | incnmaster(const char *arg) { |
| 123 | int i = arg ? atoi(arg) : 0; | 123 | int i; |
| 124 | if((lt->arrange != tile) || (nmaster + i < 1) | 124 | |
| 125 | || (wah / (nmaster + i) <= 2 * BORDERPX)) | 125 | if(!arg) |
| 126 | return; | 126 | nmaster = NMASTER; |
| 127 | nmaster += i; | 127 | else { |
| 128 | i = atoi(arg); | ||
| 129 | if((lt->arrange != tile) || (nmaster + i < 1) | ||
| 130 | || (wah / (nmaster + i) <= 2 * BORDERPX)) | ||
| 131 | return; | ||
| 132 | nmaster += i; | ||
| 133 | } | ||
| 128 | if(sel) | 134 | if(sel) |
| 129 | lt->arrange(); | 135 | lt->arrange(); |
| 130 | else | 136 | else |
| @@ -175,7 +181,7 @@ restack(void) { | |||
| 175 | 181 | ||
| 176 | void | 182 | void |
| 177 | setlayout(const char *arg) { | 183 | setlayout(const char *arg) { |
| 178 | unsigned int i; | 184 | int i; |
| 179 | 185 | ||
| 180 | if(!arg) { | 186 | if(!arg) { |
| 181 | for(i = 0; i < nlayouts && lt != &layout[i]; i++); | 187 | for(i = 0; i < nlayouts && lt != &layout[i]; i++); |
| @@ -108,7 +108,7 @@ tag(const char *arg) { | |||
| 108 | if(!sel) | 108 | if(!sel) |
| 109 | return; | 109 | return; |
| 110 | for(i = 0; i < ntags; i++) | 110 | for(i = 0; i < ntags; i++) |
| 111 | sel->tags[i] = arg ? False : True; | 111 | sel->tags[i] = arg != NULL; |
| 112 | i = arg ? atoi(arg) : 0; | 112 | i = arg ? atoi(arg) : 0; |
| 113 | if(i >= 0 && i < ntags) | 113 | if(i >= 0 && i < ntags) |
| 114 | sel->tags[i] = True; | 114 | sel->tags[i] = True; |
| @@ -135,7 +135,7 @@ toggleview(const char *arg) { | |||
| 135 | 135 | ||
| 136 | i = arg ? atoi(arg) : 0; | 136 | i = arg ? atoi(arg) : 0; |
| 137 | seltag[i] = !seltag[i]; | 137 | seltag[i] = !seltag[i]; |
| 138 | for(j = 0; j < ntags && !seltag[j]; i++); | 138 | for(j = 0; j < ntags && !seltag[j]; j++); |
| 139 | if(j == ntags) | 139 | if(j == ntags) |
| 140 | seltag[i] = True; /* cannot toggle last view */ | 140 | seltag[i] = True; /* cannot toggle last view */ |
| 141 | lt->arrange(); | 141 | lt->arrange(); |
| @@ -146,7 +146,7 @@ view(const char *arg) { | |||
| 146 | int i; | 146 | int i; |
| 147 | 147 | ||
| 148 | for(i = 0; i < ntags; i++) | 148 | for(i = 0; i < ntags; i++) |
| 149 | seltag[i] = arg ? False : True; | 149 | seltag[i] = arg != NULL; |
| 150 | i = arg ? atoi(arg) : 0; | 150 | i = arg ? atoi(arg) : 0; |
| 151 | if(i >= 0 && i < ntags) | 151 | if(i >= 0 && i < ntags) |
| 152 | seltag[i] = True; | 152 | seltag[i] = True; |
