aewl

changeset 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 f7978c6395f5
children ec8a66a2b9cc
files client.c tag.c
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
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);
     2.1 --- a/tag.c	Wed Aug 16 15:31:24 2006 +0200
     2.2 +++ b/tag.c	Wed Aug 16 15:57:36 2006 +0200
     2.3 @@ -281,7 +281,10 @@
     2.4  togglemode(Arg *arg)
     2.5  {
     2.6  	arrange = arrange == dofloat ? dotile : dofloat;
     2.7 -	arrange(NULL);
     2.8 +	if(sel)
     2.9 +		arrange(NULL);
    2.10 +	else
    2.11 +		drawstatus();
    2.12  }
    2.13  
    2.14  void