client.c
changeset 454 ffb462fb7903
parent 452 026aba558fdf
child 461 9d23330a5268
equal deleted inserted replaced
453:f30f937f9e52 454:ffb462fb7903
   221 	c->w = c->tw = wa->width;
   221 	c->w = c->tw = wa->width;
   222 	c->h = wa->height;
   222 	c->h = wa->height;
   223 	c->th = bh;
   223 	c->th = bh;
   224 
   224 
   225 	c->border = 0;
   225 	c->border = 0;
   226 	setsize(c);
   226 	updatesize(c);
   227 
   227 
   228 	if(c->x + c->w + 2 > sw)
   228 	if(c->x + c->w + 2 > sw)
   229 		c->x = sw - c->w - 2;
   229 		c->x = sw - c->w - 2;
   230 	if(c->x < 0)
   230 	if(c->x < 0)
   231 		c->x = 0;
   231 		c->x = 0;
   258 		clients->prev = c;
   258 		clients->prev = c;
   259 	c->next = clients;
   259 	c->next = clients;
   260 	c->snext = stack;
   260 	c->snext = stack;
   261 	stack = clients = c;
   261 	stack = clients = c;
   262 
   262 
   263 	settitle(c);
   263 	updatetitle(c);
   264 	ban(c);
   264 	ban(c);
   265 	XMapWindow(dpy, c->win);
   265 	XMapWindow(dpy, c->win);
   266 	XMapWindow(dpy, c->twin);
   266 	XMapWindow(dpy, c->twin);
   267 	if(isvisible(c))
   267 	if(isvisible(c))
   268 		focus(c);
   268 		focus(c);
   307 	XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
   307 	XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
   308 	XSync(dpy, False);
   308 	XSync(dpy, False);
   309 }
   309 }
   310 
   310 
   311 void
   311 void
   312 setsize(Client *c)
   312 updatesize(Client *c)
   313 {
   313 {
   314 	long msize;
   314 	long msize;
   315 	XSizeHints size;
   315 	XSizeHints size;
   316 
   316 
   317 	if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
   317 	if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
   346 	else
   346 	else
   347 		c->grav = NorthWestGravity;
   347 		c->grav = NorthWestGravity;
   348 }
   348 }
   349 
   349 
   350 void
   350 void
   351 settitle(Client *c)
   351 updatetitle(Client *c)
   352 {
   352 {
   353 	char **list = NULL;
   353 	char **list = NULL;
   354 	int n;
   354 	int n;
   355 	XTextProperty name;
   355 	XTextProperty name;
   356 
   356