dwm-meillo

diff client.c @ 473:2d8af0d7920d

implemented the maximization as I described on the mailinglist, this feels better to me.
author arg@mmvi
date Fri, 22 Sep 2006 07:37:56 +0200
parents 298be2d65d2e
children de69a7b0c8fa
line diff
     1.1 --- a/client.c	Wed Sep 20 09:53:21 2006 +0200
     1.2 +++ b/client.c	Fri Sep 22 07:37:56 2006 +0200
     1.3 @@ -89,8 +89,6 @@
     1.4  	if(!sel)
     1.5  		sel = c;
     1.6  	else if(sel != c) {
     1.7 -		if(maximized)
     1.8 -			togglemax(NULL);
     1.9  		old = sel;
    1.10  		sel = c;
    1.11  		if(old) {
    1.12 @@ -208,6 +206,10 @@
    1.13  	c->w = c->tw = wa->width;
    1.14  	c->h = wa->height;
    1.15  	c->th = bh;
    1.16 +	c->rx = sx;
    1.17 +	c->ry = bh;
    1.18 +	c->rw = sw;
    1.19 +	c->rh = sh - bh;
    1.20  
    1.21  	c->border = 0;
    1.22  	updatesize(c);
    1.23 @@ -370,41 +372,6 @@
    1.24  }
    1.25  
    1.26  void
    1.27 -togglemax(Arg *arg) {
    1.28 -	int ox, oy, ow, oh;
    1.29 -	Client *c;
    1.30 -	XEvent ev;
    1.31 -
    1.32 -	if(!sel)
    1.33 -		return;
    1.34 -
    1.35 -	if((maximized = !maximized)) {
    1.36 -		ox = sel->x;
    1.37 -		oy = sel->y;
    1.38 -		ow = sel->w;
    1.39 -		oh = sel->h;
    1.40 -		sel->x = sx;
    1.41 -		sel->y = sy + bh;
    1.42 -		sel->w = sw - 2;
    1.43 -		sel->h = sh - 2 - bh;
    1.44 -
    1.45 -		restack();
    1.46 -		for(c = getnext(clients); c; c = getnext(c->next))
    1.47 -			if(c != sel)
    1.48 -				ban(c);
    1.49 -		resize(sel, arrange == dofloat, TopLeft);
    1.50 -
    1.51 -		sel->x = ox;
    1.52 -		sel->y = oy;
    1.53 -		sel->w = ow;
    1.54 -		sel->h = oh;
    1.55 -	}
    1.56 -	else
    1.57 -		arrange(NULL);
    1.58 -	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    1.59 -}
    1.60 -
    1.61 -void
    1.62  unmanage(Client *c) {
    1.63  	Client *nc;
    1.64