aewl

diff view.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 e93b0ad5aeb5
children de69a7b0c8fa
line diff
     1.1 --- a/view.c	Wed Sep 20 09:53:21 2006 +0200
     1.2 +++ b/view.c	Fri Sep 22 07:37:56 2006 +0200
     1.3 @@ -61,8 +61,6 @@
     1.4  dofloat(Arg *arg) {
     1.5  	Client *c;
     1.6  
     1.7 -	maximized = False;
     1.8 -
     1.9  	for(c = clients; c; c = c->next) {
    1.10  		if(isvisible(c)) {
    1.11  			resize(c, True, TopLeft);
    1.12 @@ -82,8 +80,6 @@
    1.13  	int h, i, n, w;
    1.14  	Client *c;
    1.15  
    1.16 -	maximized = False;
    1.17 -
    1.18  	w = sw - mw;
    1.19  	for(n = 0, c = clients; c; c = c->next)
    1.20  		if(isvisible(c) && !c->isfloat)
    1.21 @@ -190,7 +186,7 @@
    1.22  	for(n = 0, c = clients; c; c = c->next)
    1.23  		if(isvisible(c) && !c->isfloat)
    1.24  			n++;
    1.25 -	if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized)
    1.26 +	if(!sel || sel->isfloat || n < 2 || (arrange != dotile))
    1.27  		return;
    1.28  
    1.29  	if(sel == getnext(clients)) {
    1.30 @@ -273,13 +269,28 @@
    1.31  
    1.32  void
    1.33  zoom(Arg *arg) {
    1.34 +	int tmp;
    1.35  	unsigned int n;
    1.36  	Client *c;
    1.37 +	XEvent ev;
    1.38 +
    1.39 +	if(!sel)
    1.40 +		return;
    1.41 +
    1.42 +	if(sel->isfloat || (arrange == dofloat)) {
    1.43 +		tmp = sel->x; sel->x = sel->rx; sel->rx = tmp;
    1.44 +		tmp = sel->y; sel->y = sel->ry; sel->ry = tmp;
    1.45 +		tmp = sel->w; sel->w = sel->rw; sel->rw = tmp;
    1.46 +		tmp = sel->h; sel->h = sel->rh; sel->rh = tmp;
    1.47 +		resize(sel, True, TopLeft);
    1.48 +		while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    1.49 +		return;
    1.50 +	}
    1.51  
    1.52  	for(n = 0, c = clients; c; c = c->next)
    1.53  		if(isvisible(c) && !c->isfloat)
    1.54  			n++;
    1.55 -	if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized)
    1.56 +	if(n < 2 || (arrange != dotile))
    1.57  		return;
    1.58  
    1.59  	if((c = sel) == nexttiled(clients))