aewl

diff client.c @ 306:71f02d14dce1

added general centralization rule for new clients (works around various borken apps)
author Anselm R.Garbe <arg@10ksloc.org>
date Wed, 16 Aug 2006 15:57:36 +0200
parents 8e6e0aa5e2ae
children ec8a66a2b9cc
line diff
     1.1 --- a/client.c	Wed Aug 16 15:31:24 2006 +0200
     1.2 +++ b/client.c	Wed Aug 16 15:57:36 2006 +0200
     1.3 @@ -187,7 +187,7 @@
     1.4  void
     1.5  manage(Window w, XWindowAttributes *wa)
     1.6  {
     1.7 -	Client *c;
     1.8 +	Client *c, *tc;
     1.9  	Window trans;
    1.10  	XSetWindowAttributes twa;
    1.11  
    1.12 @@ -258,6 +258,15 @@
    1.13  				c->maxw == c->minw && c->maxh == c->minh);
    1.14  	settitle(c);
    1.15  
    1.16 +	if(trans && (tc = getclient(trans))) {
    1.17 +		c->x = (tc->x + tc->w / 2) - (c->w / 2);
    1.18 +		c->y = (tc->y + tc->h / 2) - (c->h / 2);
    1.19 +	}
    1.20 +	else {
    1.21 +		c->x = (sw / 2) - (c->w / 2);
    1.22 +		c->y = ((sh - bh) / 2) - (c->h / 2) + bh;
    1.23 +	}
    1.24 +
    1.25  	if(isvisible(c))
    1.26  		sel = c;
    1.27  	arrange(NULL);