small bugfix
57116092
2 file(s) · +15 −9
| 120 | 120 | ||
| 121 | 121 | void |
|
| 122 | 122 | incnmaster(const char *arg) { |
|
| 123 | - | int i = arg ? atoi(arg) : 0; |
|
| 124 | - | if((lt->arrange != tile) || (nmaster + i < 1) |
|
| 125 | - | || (wah / (nmaster + i) <= 2 * BORDERPX)) |
|
| 126 | - | return; |
|
| 127 | - | nmaster += i; |
|
| 123 | + | int i; |
|
| 124 | + | ||
| 125 | + | if(!arg) |
|
| 126 | + | nmaster = NMASTER; |
|
| 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 | 134 | if(sel) |
|
| 129 | 135 | lt->arrange(); |
|
| 130 | 136 | else |
|
| 175 | 181 | ||
| 176 | 182 | void |
|
| 177 | 183 | setlayout(const char *arg) { |
|
| 178 | - | unsigned int i; |
|
| 184 | + | int i; |
|
| 179 | 185 | ||
| 180 | 186 | if(!arg) { |
|
| 181 | 187 | for(i = 0; i < nlayouts && lt != &layout[i]; i++); |
|
| 108 | 108 | if(!sel) |
|
| 109 | 109 | return; |
|
| 110 | 110 | for(i = 0; i < ntags; i++) |
|
| 111 | - | sel->tags[i] = arg ? False : True; |
|
| 111 | + | sel->tags[i] = arg != NULL; |
|
| 112 | 112 | i = arg ? atoi(arg) : 0; |
|
| 113 | 113 | if(i >= 0 && i < ntags) |
|
| 114 | 114 | sel->tags[i] = True; |
|
| 135 | 135 | ||
| 136 | 136 | i = arg ? atoi(arg) : 0; |
|
| 137 | 137 | seltag[i] = !seltag[i]; |
|
| 138 | - | for(j = 0; j < ntags && !seltag[j]; i++); |
|
| 138 | + | for(j = 0; j < ntags && !seltag[j]; j++); |
|
| 139 | 139 | if(j == ntags) |
|
| 140 | 140 | seltag[i] = True; /* cannot toggle last view */ |
|
| 141 | 141 | lt->arrange(); |
|
| 146 | 146 | int i; |
|
| 147 | 147 | ||
| 148 | 148 | for(i = 0; i < ntags; i++) |
|
| 149 | - | seltag[i] = arg ? False : True; |
|
| 149 | + | seltag[i] = arg != NULL; |
|
| 150 | 150 | i = arg ? atoi(arg) : 0; |
|
| 151 | 151 | if(i >= 0 && i < ntags) |
|
| 152 | 152 | seltag[i] = True; |
|