aewl

diff client.c @ 163:e2e1de08341d

new stuff
author arg@10ksloc.org
date Wed, 02 Aug 2006 13:05:04 +0200
parents f381e34158d9
children 21071ae1fe68
line diff
     1.1 --- a/client.c	Wed Aug 02 12:33:24 2006 +0200
     1.2 +++ b/client.c	Wed Aug 02 13:05:04 2006 +0200
     1.3 @@ -219,12 +219,13 @@
     1.4  	c->h = wa->height;
     1.5  	c->th = bh;
     1.6  
     1.7 -	if(c->y < bh)
     1.8 +	c->border = 1;
     1.9 +	setsize(c);
    1.10 +
    1.11 +	if(c->h != sh && c->y < bh)
    1.12  		c->y = c->ty = bh;
    1.13  
    1.14 -	c->border = 1;
    1.15  	c->proto = getproto(c->win);
    1.16 -	setsize(c);
    1.17  	XSelectInput(dpy, c->win,
    1.18  		StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
    1.19  	XGetTransientForHint(dpy, c->win, &trans);
    1.20 @@ -237,8 +238,6 @@
    1.21  			DefaultVisual(dpy, screen),
    1.22  			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
    1.23  
    1.24 -	settags(c);
    1.25 -
    1.26  	if(clients)
    1.27  		clients->prev = c;
    1.28  	c->next = clients;
    1.29 @@ -251,11 +250,12 @@
    1.30  	XGrabButton(dpy, Button3, MODKEY, c->win, False, BUTTONMASK,
    1.31  			GrabModeAsync, GrabModeSync, None, None);
    1.32  
    1.33 +	settags(c);
    1.34  	if(!c->isfloat)
    1.35 -		c->isfloat = trans || (c->maxw && c->minw &&
    1.36 -				(c->maxw == c->minw) && (c->maxh == c->minh));
    1.37 -
    1.38 -
    1.39 +		c->isfloat = trans
    1.40 +			|| (c->maxw && c->minw &&
    1.41 +				c->maxw == c->minw && c->maxh == c->minh)
    1.42 +			|| (c->w == sw && c->h == sh);
    1.43  	settitle(c);
    1.44  	arrange(NULL);
    1.45  
    1.46 @@ -272,6 +272,7 @@
    1.47  	int bottom = c->y + c->h;
    1.48  	int right = c->x + c->w;
    1.49  	XConfigureEvent e;
    1.50 +	XWindowChanges wc;
    1.51  
    1.52  	if(sizehints) {
    1.53  		if(c->incw)
    1.54 @@ -287,18 +288,23 @@
    1.55  		if(c->maxh && c->h > c->maxh)
    1.56  			c->h = c->maxh;
    1.57  	}
    1.58 -	if(c->x > sw) /* might happen on restart */
    1.59 -		c->x = sw - c->w;
    1.60 -	if(c->y > sh)
    1.61 -		c->y = sh - c->h;
    1.62 +	if(c->x > right) /* might happen on restart */
    1.63 +		c->x = right - c->w;
    1.64 +	if(c->y > bottom)
    1.65 +		c->y = bottom - c->h;
    1.66  	if(sticky == TopRight || sticky == BotRight)
    1.67  		c->x = right - c->w;
    1.68  	if(sticky == BotLeft || sticky == BotRight)
    1.69  		c->y = bottom - c->h;
    1.70  
    1.71  	resizetitle(c);
    1.72 -	XSetWindowBorderWidth(dpy, c->win, 1);
    1.73 -	XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
    1.74 +	wc.x = c->x;
    1.75 +	wc.y = c->y;
    1.76 +	wc.width = c->w;
    1.77 +	wc.height = c->h;
    1.78 +	wc.border_width = 1;
    1.79 +	XConfigureWindow(dpy, c->win,
    1.80 +			CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
    1.81  
    1.82  	e.type = ConfigureNotify;
    1.83  	e.event = c->win;