diff options
| author | arg@mig29 <unknown> | 2006-11-22 16:17:50 +0100 |
|---|---|---|
| committer | arg@mig29 <unknown> | 2006-11-22 16:17:50 +0100 |
| commit | 321e8d51edb8fe433e8e2ce8d5463c6999cc0576 (patch) | |
| tree | 9e81a8c26380624457292923992b1287710d4c13 | |
| parent | added a similiar patch to Daves solution to indicate if there are clients wit... (diff) | |
| download | dwm-321e8d51edb8fe433e8e2ce8d5463c6999cc0576.tar.gz dwm-321e8d51edb8fe433e8e2ce8d5463c6999cc0576.zip | |
fififif
| -rw-r--r-- | dwm.h | 2 | ||||
| -rw-r--r-- | tag.c | 3 | ||||
| -rw-r--r-- | view.c | 33 |
3 files changed, 1 insertions, 37 deletions
| @@ -82,7 +82,7 @@ struct Client { | |||
| 82 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; | 82 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
| 83 | int grav; | 83 | int grav; |
| 84 | long flags; | 84 | long flags; |
| 85 | unsigned int border, weight; | 85 | unsigned int border; |
| 86 | Bool isfloat, isfixed, ismax; | 86 | Bool isfloat, isfixed, ismax; |
| 87 | Bool *tags; | 87 | Bool *tags; |
| 88 | Client *next; | 88 | Client *next; |
| @@ -104,7 +104,6 @@ settags(Client *c, Client *trans) { | |||
| 104 | if(!matched) | 104 | if(!matched) |
| 105 | for(i = 0; i < ntags; i++) | 105 | for(i = 0; i < ntags; i++) |
| 106 | c->tags[i] = seltag[i]; | 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 | void | 109 | void |
| @@ -116,7 +115,6 @@ tag(Arg *arg) { | |||
| 116 | for(i = 0; i < ntags; i++) | 115 | for(i = 0; i < ntags; i++) |
| 117 | sel->tags[i] = False; | 116 | sel->tags[i] = False; |
| 118 | sel->tags[arg->i] = True; | 117 | sel->tags[arg->i] = True; |
| 119 | sel->weight = arg->i; | ||
| 120 | arrange(); | 118 | arrange(); |
| 121 | } | 119 | } |
| 122 | 120 | ||
| @@ -130,6 +128,5 @@ toggletag(Arg *arg) { | |||
| 130 | for(i = 0; i < ntags && !sel->tags[i]; i++); | 128 | for(i = 0; i < ntags && !sel->tags[i]; i++); |
| 131 | if(i == ntags) | 129 | if(i == ntags) |
| 132 | sel->tags[arg->i] = True; | 130 | sel->tags[arg->i] = True; |
| 133 | sel->weight = (i == ntags) ? arg->i : i; | ||
| 134 | arrange(); | 131 | arrange(); |
| 135 | } | 132 | } |
| @@ -6,42 +6,12 @@ | |||
| 6 | /* static */ | 6 | /* static */ |
| 7 | 7 | ||
| 8 | static Client * | 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 | nexttiled(Client *c) { | 9 | nexttiled(Client *c) { |
| 22 | for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); | 10 | for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); |
| 23 | return c; | 11 | return c; |
| 24 | } | 12 | } |
| 25 | 13 | ||
| 26 | static void | 14 | 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 | } | ||
| 43 | |||
| 44 | static void | ||
| 45 | togglemax(Client *c) { | 15 | togglemax(Client *c) { |
| 46 | XEvent ev; | 16 | XEvent ev; |
| 47 | 17 | ||
| @@ -247,7 +217,6 @@ toggleview(Arg *arg) { | |||
| 247 | for(i = 0; i < ntags && !seltag[i]; i++); | 217 | for(i = 0; i < ntags && !seltag[i]; i++); |
| 248 | if(i == ntags) | 218 | if(i == ntags) |
| 249 | seltag[arg->i] = True; /* cannot toggle last view */ | 219 | seltag[arg->i] = True; /* cannot toggle last view */ |
| 250 | reorder(); | ||
| 251 | arrange(); | 220 | arrange(); |
| 252 | } | 221 | } |
| 253 | 222 | ||
| @@ -258,7 +227,6 @@ view(Arg *arg) { | |||
| 258 | for(i = 0; i < ntags; i++) | 227 | for(i = 0; i < ntags; i++) |
| 259 | seltag[i] = False; | 228 | seltag[i] = False; |
| 260 | seltag[arg->i] = True; | 229 | seltag[arg->i] = True; |
| 261 | reorder(); | ||
| 262 | arrange(); | 230 | arrange(); |
| 263 | } | 231 | } |
| 264 | 232 | ||
| @@ -268,7 +236,6 @@ viewall(Arg *arg) { | |||
| 268 | 236 | ||
| 269 | for(i = 0; i < ntags; i++) | 237 | for(i = 0; i < ntags; i++) |
| 270 | seltag[i] = True; | 238 | seltag[i] = True; |
| 271 | reorder(); | ||
| 272 | arrange(); | 239 | arrange(); |
| 273 | } | 240 | } |
| 274 | 241 | ||
