summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/dwm.c b/dwm.c
index c9a6b0a..bad06f4 100644
--- a/dwm.c
+++ b/dwm.c
@@ -179,7 +179,7 @@ static void setclientstate(Client *c, long state);
179static void setlayout(const Arg *arg); 179static void setlayout(const Arg *arg);
180static void setmfact(const Arg *arg); 180static void setmfact(const Arg *arg);
181static void setup(void); 181static void setup(void);
182static void showhide(Client *c); 182static void showhide(Client *c, unsigned int ntiled);
183static void sigchld(int signal); 183static void sigchld(int signal);
184static void spawn(const Arg *arg); 184static void spawn(const Arg *arg);
185static void tag(const Arg *arg); 185static void tag(const Arg *arg);
@@ -283,7 +283,11 @@ applyrules(Client *c) {
283 283
284void 284void
285arrange(void) { 285arrange(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 focus(NULL); 291 focus(NULL);
288 if(lt[sellt]->arrange) 292 if(lt[sellt]->arrange)
289 lt[sellt]->arrange(); 293 lt[sellt]->arrange();
@@ -1341,18 +1345,19 @@ setup(void) {
1341} 1345}
1342 1346
1343void 1347void
1344showhide(Client *c) { 1348showhide(Client *c, unsigned int ntiled) {
1345 if(!c) 1349 if(!c)
1346 return; 1350 return;
1347 if(ISVISIBLE(c)) { /* show clients top down */ 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 XMoveWindow(dpy, c->win, c->x, c->y); 1354 XMoveWindow(dpy, c->win, c->x, c->y);
1350 if(!lt[sellt]->arrange || c->isfloating) 1355 if(!lt[sellt]->arrange || c->isfloating)
1351 resize(c, c->x, c->y, c->w, c->h, True); 1356 resize(c, c->x, c->y, c->w, c->h, True);
1352 showhide(c->snext); 1357 showhide(c->snext, ntiled);
1353 } 1358 }
1354 else { /* hide clients bottom up */ 1359 else { /* hide clients bottom up */
1355 showhide(c->snext); 1360 showhide(c->snext, ntiled);
1356 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 1361 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
1357 } 1362 }
1358} 1363}