fififif
321e8d51
3 file(s) · +1 −37
| 82 | 82 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
|
| 83 | 83 | int grav; |
|
| 84 | 84 | long flags; |
|
| 85 | - | unsigned int border, weight; |
|
| 85 | + | unsigned int border; |
|
| 86 | 86 | Bool isfloat, isfixed, ismax; |
|
| 87 | 87 | Bool *tags; |
|
| 88 | 88 | Client *next; |
| 104 | 104 | if(!matched) |
|
| 105 | 105 | for(i = 0; i < ntags; i++) |
|
| 106 | 106 | c->tags[i] = seltag[i]; |
|
| 107 | - | for(c->weight = 0; c->weight < ntags && !c->tags[c->weight]; c->weight++); |
|
| 108 | 107 | } |
|
| 109 | 108 | ||
| 110 | 109 | void |
|
| 116 | 115 | for(i = 0; i < ntags; i++) |
|
| 117 | 116 | sel->tags[i] = False; |
|
| 118 | 117 | sel->tags[arg->i] = True; |
|
| 119 | - | sel->weight = arg->i; |
|
| 120 | 118 | arrange(); |
|
| 121 | 119 | } |
|
| 122 | 120 | ||
| 130 | 128 | for(i = 0; i < ntags && !sel->tags[i]; i++); |
|
| 131 | 129 | if(i == ntags) |
|
| 132 | 130 | sel->tags[arg->i] = True; |
|
| 133 | - | sel->weight = (i == ntags) ? arg->i : i; |
|
| 134 | 131 | arrange(); |
|
| 135 | 132 | } |
|
| 6 | 6 | /* static */ |
|
| 7 | 7 | ||
| 8 | 8 | static Client * |
|
| 9 | - | minclient(void) { |
|
| 10 | - | Client *c, *min; |
|
| 11 | - | ||
| 12 | - | if((clients && clients->isfloat) || arrange == dofloat) |
|
| 13 | - | return clients; /* don't touch floating order */ |
|
| 14 | - | for(min = c = clients; c; c = c->next) |
|
| 15 | - | if(c->weight < min->weight) |
|
| 16 | - | min = c; |
|
| 17 | - | return min; |
|
| 18 | - | } |
|
| 19 | - | ||
| 20 | - | static Client * |
|
| 21 | 9 | nexttiled(Client *c) { |
|
| 22 | 10 | for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); |
|
| 23 | 11 | return c; |
|
| 24 | - | } |
|
| 25 | - | ||
| 26 | - | static void |
|
| 27 | - | reorder(void) { |
|
| 28 | - | Client *c, *newclients, *tail; |
|
| 29 | - | ||
| 30 | - | newclients = tail = NULL; |
|
| 31 | - | while((c = minclient())) { |
|
| 32 | - | detach(c); |
|
| 33 | - | if(tail) { |
|
| 34 | - | c->prev = tail; |
|
| 35 | - | tail->next = c; |
|
| 36 | - | tail = c; |
|
| 37 | - | } |
|
| 38 | - | else |
|
| 39 | - | tail = newclients = c; |
|
| 40 | - | } |
|
| 41 | - | clients = newclients; |
|
| 42 | 12 | } |
|
| 43 | 13 | ||
| 44 | 14 | static void |
|
| 247 | 217 | for(i = 0; i < ntags && !seltag[i]; i++); |
|
| 248 | 218 | if(i == ntags) |
|
| 249 | 219 | seltag[arg->i] = True; /* cannot toggle last view */ |
|
| 250 | - | reorder(); |
|
| 251 | 220 | arrange(); |
|
| 252 | 221 | } |
|
| 253 | 222 | ||
| 258 | 227 | for(i = 0; i < ntags; i++) |
|
| 259 | 228 | seltag[i] = False; |
|
| 260 | 229 | seltag[arg->i] = True; |
|
| 261 | - | reorder(); |
|
| 262 | 230 | arrange(); |
|
| 263 | 231 | } |
|
| 264 | 232 | ||
| 268 | 236 | ||
| 269 | 237 | for(i = 0; i < ntags; i++) |
|
| 270 | 238 | seltag[i] = True; |
|
| 271 | - | reorder(); |
|
| 272 | 239 | arrange(); |
|
| 273 | 240 | } |
|
| 274 | 241 | ||