dwm.c
changeset 1393 deaa276abac1
parent 1392 ee12ffbf93df
child 1395 a2c094196714
equal deleted inserted replaced
1392:ee12ffbf93df 1393:deaa276abac1
   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, unsigned int ntiled);
   182 static void showhide(Client *c);
   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);
   336 	return *x != c->x || *y != c->y || *w != c->w || *h != c->h;
   336 	return *x != c->x || *y != c->y || *w != c->w || *h != c->h;
   337 }
   337 }
   338 
   338 
   339 void
   339 void
   340 arrange(void) {
   340 arrange(void) {
   341 	unsigned int nt;
   341 	showhide(stack);
   342 	Client *c;
       
   343 
       
   344 	for(nt = 0, c = nexttiled(clients); c; c = nexttiled(c->next), nt++);
       
   345 	showhide(stack, nt);
       
   346 	focus(NULL);
   342 	focus(NULL);
   347 	if(lt[sellt]->arrange)
   343 	if(lt[sellt]->arrange)
   348 		lt[sellt]->arrange();
   344 		lt[sellt]->arrange();
   349 	restack();
   345 	restack();
   350 }
   346 }
  1328 
  1324 
  1329 	grabkeys();
  1325 	grabkeys();
  1330 }
  1326 }
  1331 
  1327 
  1332 void
  1328 void
  1333 showhide(Client *c, unsigned int ntiled) {
  1329 showhide(Client *c) {
  1334 	if(!c)
  1330 	if(!c)
  1335 		return;
  1331 		return;
  1336 	if(ISVISIBLE(c)) { /* show clients top down */
  1332 	if(ISVISIBLE(c)) { /* show clients top down */
  1337 		XMoveWindow(dpy, c->win, c->x, c->y);
  1333 		XMoveWindow(dpy, c->win, c->x, c->y);
  1338 		if(!lt[sellt]->arrange || c->isfloating)
  1334 		if(!lt[sellt]->arrange || c->isfloating)
  1339 			resize(c, c->x, c->y, c->w, c->h);
  1335 			resize(c, c->x, c->y, c->w, c->h);
  1340 		showhide(c->snext, ntiled);
  1336 		showhide(c->snext);
  1341 	}
  1337 	}
  1342 	else { /* hide clients bottom up */
  1338 	else { /* hide clients bottom up */
  1343 		showhide(c->snext, ntiled);
  1339 		showhide(c->snext);
  1344 		XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
  1340 		XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
  1345 	}
  1341 	}
  1346 }
  1342 }
  1347 
  1343 
  1348 
  1344