aewl

changeset 480:680aca428830

small change to achieve Jukka's last proposal
author arg@mmvi
date Fri, 22 Sep 2006 13:53:28 +0200
parents de69a7b0c8fa
children 382e3cb5d9a5
files dwm.h view.c
diffstat 2 files changed, 34 insertions(+), 14 deletions(-) [+]
line diff
     1.1 --- a/dwm.h	Fri Sep 22 11:49:24 2006 +0200
     1.2 +++ b/dwm.h	Fri Sep 22 13:53:28 2006 +0200
     1.3 @@ -77,12 +77,13 @@
     1.4  	char name[256];
     1.5  	int proto;
     1.6  	int x, y, w, h;
     1.7 +	int rx, ry, rw, rh; /* revert geometry */
     1.8  	int tx, ty, tw, th; /* title window geometry */
     1.9  	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
    1.10  	int grav;
    1.11  	long flags; 
    1.12  	unsigned int border, weight;
    1.13 -	Bool isfloat;
    1.14 +	Bool isfloat, ismax;
    1.15  	Bool *tags;
    1.16  	Client *next;
    1.17  	Client *prev;
     2.1 --- a/view.c	Fri Sep 22 11:49:24 2006 +0200
     2.2 +++ b/view.c	Fri Sep 22 13:53:28 2006 +0200
     2.3 @@ -18,6 +18,12 @@
     2.4  	return min;
     2.5  }
     2.6  
     2.7 +static Client *
     2.8 +nexttiled(Client *c) {
     2.9 +	for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
    2.10 +	return c;
    2.11 +}
    2.12 +
    2.13  static void
    2.14  reorder() {
    2.15  	Client *c, *newclients, *tail;
    2.16 @@ -36,10 +42,23 @@
    2.17  	clients = newclients;
    2.18  }
    2.19  
    2.20 -static Client *
    2.21 -nexttiled(Client *c) {
    2.22 -	for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
    2.23 -	return c;
    2.24 +static void
    2.25 +togglemax(Client *c)
    2.26 +{
    2.27 +	if((c->ismax = !c->ismax)) {
    2.28 +		c->rx = c->x; c->x = sx;
    2.29 +		c->ry = c->y; c->y = bh;
    2.30 +		c->rw = c->w; c->w = sw;
    2.31 +		c->rh = c->h; c->h = sh;
    2.32 +	}
    2.33 +	else {
    2.34 +		c->x = c->rx;
    2.35 +		c->y = c->ry;
    2.36 +		c->w = c->w;
    2.37 +		c->h = c->h;
    2.38 +	}
    2.39 +	resize(c, True, TopLeft);
    2.40 +	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    2.41  }
    2.42  
    2.43  /* extern */
    2.44 @@ -82,8 +101,14 @@
    2.45  
    2.46  	w = sw - mw;
    2.47  	for(n = 0, c = clients; c; c = c->next)
    2.48 -		if(isvisible(c) && !c->isfloat)
    2.49 -			n++;
    2.50 +		if(isvisible(c)) {
    2.51 +			if(c->isfloat) {
    2.52 +				if(c->ismax)
    2.53 +					togglemax(c);
    2.54 +			}
    2.55 +			else
    2.56 +				n++;
    2.57 +		}
    2.58  
    2.59  	if(n > 1)
    2.60  		h = (sh - bh) / (n - 1);
    2.61 @@ -269,7 +294,6 @@
    2.62  
    2.63  void
    2.64  zoom(Arg *arg) {
    2.65 -	int tmp;
    2.66  	unsigned int n;
    2.67  	Client *c;
    2.68  	XEvent ev;
    2.69 @@ -278,12 +302,7 @@
    2.70  		return;
    2.71  
    2.72  	if(sel->isfloat || (arrange == dofloat)) {
    2.73 -		sel->x = sx;
    2.74 -		sel->y = bh;
    2.75 -		sel->w = sw;
    2.76 -		sel->h = sh - bh;
    2.77 -		resize(sel, True, TopLeft);
    2.78 -		while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    2.79 +		togglemax(sel);
    2.80  		return;
    2.81  	}
    2.82