avoid reverting the border if it's not necessary (avoids some flashing on view())
76d7e80f
1 file(s) · +11 −6
| 179 | 179 | static void setlayout(const Arg *arg); |
|
| 180 | 180 | static void setmfact(const Arg *arg); |
|
| 181 | 181 | static void setup(void); |
|
| 182 | - | static void showhide(Client *c); |
|
| 182 | + | static void showhide(Client *c, unsigned int ntiled); |
|
| 183 | 183 | static void sigchld(int signal); |
|
| 184 | 184 | static void spawn(const Arg *arg); |
|
| 185 | 185 | static void tag(const Arg *arg); |
|
| 283 | 283 | ||
| 284 | 284 | void |
|
| 285 | 285 | arrange(void) { |
|
| 286 | - | showhide(stack); |
|
| 286 | + | unsigned int nt; |
|
| 287 | + | Client *c; |
|
| 288 | + | ||
| 289 | + | for(nt = 0, c = nexttiled(clients); c; c = nexttiled(c->next), nt++); |
|
| 290 | + | showhide(stack, nt); |
|
| 287 | 291 | focus(NULL); |
|
| 288 | 292 | if(lt[sellt]->arrange) |
|
| 289 | 293 | lt[sellt]->arrange(); |
|
| 1341 | 1345 | } |
|
| 1342 | 1346 | ||
| 1343 | 1347 | void |
|
| 1344 | - | showhide(Client *c) { |
|
| 1348 | + | showhide(Client *c, unsigned int ntiled) { |
|
| 1345 | 1349 | if(!c) |
|
| 1346 | 1350 | return; |
|
| 1347 | 1351 | if(ISVISIBLE(c)) { /* show clients top down */ |
|
| 1348 | - | adjustborder(c, borderpx); |
|
| 1352 | + | if(ntiled > 1) /* avoid unnecessary border reverts */ |
|
| 1353 | + | adjustborder(c, borderpx); |
|
| 1349 | 1354 | XMoveWindow(dpy, c->win, c->x, c->y); |
|
| 1350 | 1355 | if(!lt[sellt]->arrange || c->isfloating) |
|
| 1351 | 1356 | resize(c, c->x, c->y, c->w, c->h, True); |
|
| 1352 | - | showhide(c->snext); |
|
| 1357 | + | showhide(c->snext, ntiled); |
|
| 1353 | 1358 | } |
|
| 1354 | 1359 | else { /* hide clients bottom up */ |
|
| 1355 | - | showhide(c->snext); |
|
| 1360 | + | showhide(c->snext, ntiled); |
|
| 1356 | 1361 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); |
|
| 1357 | 1362 | } |
|
| 1358 | 1363 | } |
|