dwm-meillo

diff client.c @ 314:8bafc3ac9f58

made a new client position strategy similiar to that one proposed by Sander, but which takes top bar into account
author Anselm R.Garbe <arg@10ksloc.org>
date Fri, 18 Aug 2006 08:39:33 +0200
parents 8b109976c594
children d9bef4067cd5
line diff
     1.1 --- a/client.c	Thu Aug 17 10:06:36 2006 +0200
     1.2 +++ b/client.c	Fri Aug 18 08:39:33 2006 +0200
     1.3 @@ -203,8 +203,14 @@
     1.4  	c->border = 0;
     1.5  	setsize(c);
     1.6  
     1.7 +	if(c->x + c->w > sw)
     1.8 +		c->x = sw - c->w - 2;
     1.9 +	if(c->x < 0)
    1.10 +		c->x = 0;
    1.11 +	if(c->y + c->h > sh)
    1.12 +		c->y = sh - c->h - 2;
    1.13  	if(c->h != sh && c->y < bh)
    1.14 -		c->y = c->ty = bh;
    1.15 +		c->y = bh;
    1.16  
    1.17  	c->proto = getproto(c->win);
    1.18  	XSelectInput(dpy, c->win,
    1.19 @@ -257,12 +263,6 @@
    1.20  			|| (c->maxw && c->minw &&
    1.21  				c->maxw == c->minw && c->maxh == c->minh);
    1.22  	settitle(c);
    1.23 -
    1.24 -	if(!trans) {
    1.25 -		c->x = (sw / 2) - (c->w / 2);
    1.26 -		c->y = ((sh - bh) / 2) - (c->h / 2) + bh;
    1.27 -	}
    1.28 -
    1.29  	if(isvisible(c))
    1.30  		sel = c;
    1.31  	arrange(NULL);