aewl

diff client.c @ 718:09452e717bfd

applied offscreen appearance hotfix
author Anselm R. Garbe <arg@suckless.org>
date Wed, 24 Jan 2007 17:24:55 +0100
parents 4ce65f61f01b
children d3876aa79292
line diff
     1.1 --- a/client.c	Wed Jan 24 12:12:29 2007 +0100
     1.2 +++ b/client.c	Wed Jan 24 17:24:55 2007 +0100
     1.3 @@ -142,14 +142,14 @@
     1.4  	}
     1.5  	else {
     1.6  		c->border = BORDERPX;
     1.7 +		if(c->x + c->w + 2 * c->border > wax + waw)
     1.8 +			c->x = wax + waw - c->w - 2 * c->border;
     1.9 +		if(c->y + c->h + 2 * c->border > way + wah)
    1.10 +			c->y = way + wah - c->h - 2 * c->border;
    1.11  		if(c->x < wax)
    1.12  			c->x = wax;
    1.13  		if(c->y < way)
    1.14  			c->y = way;
    1.15 -		if(c->x + c->w + 2 * c->border > wax + waw)
    1.16 -			c->x = wax + waw - c->w - 2 * c->border;
    1.17 -		if(c->y + c->h + 2 * c->border > way + wah)
    1.18 -			c->y = way + wah - c->h - 2 * c->border;
    1.19  	}
    1.20  	updatesizehints(c);
    1.21  	c->proto = getproto(c->win);
    1.22 @@ -197,14 +197,14 @@
    1.23  	else
    1.24  		c->border = BORDERPX;
    1.25  	/* offscreen appearance fixes */
    1.26 +	if(c->x > sw)
    1.27 +		c->x = sw - c->w - 2 * c->border;
    1.28 +	if(c->y > sh)
    1.29 +		c->y = sh - c->h - 2 * c->border;
    1.30  	if(c->x + c->w + 2 * c->border < sx)
    1.31  		c->x = sx;
    1.32  	if(c->y + c->h + 2 * c->border < sy)
    1.33  		c->y = sy;
    1.34 -	if(c->x > sw)
    1.35 -		c->x = sw - c->w - 2 * c->border;
    1.36 -	if(c->y > sh)
    1.37 -		c->y = sh - c->h - 2 * c->border;
    1.38  	wc.x = c->x;
    1.39  	wc.y = c->y;
    1.40  	wc.width = c->w;