dwm.c
changeset 1381 8b7836a471f8
parent 1380 add6eb26ebaa
child 1383 85a78d8afa0f
equal deleted inserted replaced
1380:add6eb26ebaa 1381:8b7836a471f8
   177 static void scan(void);
   177 static void scan(void);
   178 static void setclientstate(Client *c, long state);
   178 static void setclientstate(Client *c, long state);
   179 static void setlayout(const Arg *arg);
   179 static void setlayout(const Arg *arg);
   180 static void setmfact(const Arg *arg);
   180 static void setmfact(const Arg *arg);
   181 static void setup(void);
   181 static void setup(void);
   182 static void showhide(Client *c);
   182 static void showhide(Client *c, unsigned int ntiled);
   183 static void sigchld(int signal);
   183 static void sigchld(int signal);
   184 static void spawn(const Arg *arg);
   184 static void spawn(const Arg *arg);
   185 static void tag(const Arg *arg);
   185 static void tag(const Arg *arg);
   186 static int textnw(const char *text, unsigned int len);
   186 static int textnw(const char *text, unsigned int len);
   187 static void tile(void);
   187 static void tile(void);
   281 		c->tags = tagset[seltags];
   281 		c->tags = tagset[seltags];
   282 }
   282 }
   283 
   283 
   284 void
   284 void
   285 arrange(void) {
   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 	focus(NULL);
   291 	focus(NULL);
   288 	if(lt[sellt]->arrange)
   292 	if(lt[sellt]->arrange)
   289 		lt[sellt]->arrange();
   293 		lt[sellt]->arrange();
   290 	restack();
   294 	restack();
   291 }
   295 }
  1339 
  1343 
  1340 	grabkeys();
  1344 	grabkeys();
  1341 }
  1345 }
  1342 
  1346 
  1343 void
  1347 void
  1344 showhide(Client *c) {
  1348 showhide(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 }
  1359 
  1364 
  1360 
  1365