aewl

diff aewl.c @ 768:a1c6805aa018

simplified and corrected domax() and restack()
author meillo@marmaro.de
date Fri, 05 Dec 2008 21:14:50 +0100
parents 706991d15451
children 49aa8ccceefa
line diff
     1.1 --- a/aewl.c	Fri Dec 05 20:50:31 2008 +0100
     1.2 +++ b/aewl.c	Fri Dec 05 21:14:50 2008 +0100
     1.3 @@ -314,22 +314,6 @@
     1.4  
     1.5  /* begin code by mitch */
     1.6  void
     1.7 -arrangemax(Client *c) {
     1.8 -  if(c == sel) {
     1.9 -    c->ismax = True;
    1.10 -    c->x = sx;
    1.11 -    c->y = bh;
    1.12 -    c->w = sw - 2 * BORDERPX;
    1.13 -    c->h = sh - bh - 2 * BORDERPX;
    1.14 -    XRaiseWindow(dpy, c->win);
    1.15 -  } else {
    1.16 -    c->ismax = False;
    1.17 -    XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
    1.18 -    XLowerWindow(dpy, c->win);
    1.19 -  }
    1.20 -}
    1.21 -
    1.22 -void
    1.23  domax(void) {
    1.24    Client *c;
    1.25  
    1.26 @@ -339,12 +323,15 @@
    1.27          resize(c, True);
    1.28          continue;
    1.29        }
    1.30 -      arrangemax(c);
    1.31 +			c->ismax = True;
    1.32 +			c->x = sx;
    1.33 +			c->y = bh;
    1.34 +			c->w = sw - 2 * BORDERPX;
    1.35 +			c->h = sh - bh - 2 * BORDERPX;
    1.36        resize(c, False);
    1.37      } else {
    1.38        XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
    1.39      }
    1.40 -
    1.41    }
    1.42    if(!sel || !isvisible(sel)) {
    1.43      for(c = stack; c && !isvisible(c); c = c->snext);
    1.44 @@ -406,24 +393,14 @@
    1.45  	if(sel->isfloat)
    1.46  		XRaiseWindow(dpy, sel->win);
    1.47  
    1.48 -  /* begin code by mitch */
    1.49 -  if(arrange == domax) {
    1.50 -    for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
    1.51 -      arrangemax(c);
    1.52 -      resize(c, False);
    1.53 -    }
    1.54 +	if(!sel->isfloat)
    1.55 +		XLowerWindow(dpy, sel->win);
    1.56 +	for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
    1.57 +		if(c == sel)
    1.58 +			continue;
    1.59 +		XLowerWindow(dpy, c->win);
    1.60 +	}
    1.61  
    1.62 -  } else if (arrange == dotile) {
    1.63 -  /* end code by mitch */
    1.64 -
    1.65 -		if(!sel->isfloat)
    1.66 -			XLowerWindow(dpy, sel->win);
    1.67 -		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
    1.68 -			if(c == sel)
    1.69 -				continue;
    1.70 -			XLowerWindow(dpy, c->win);
    1.71 -		}
    1.72 -	}
    1.73  	XSync(dpy, False);
    1.74  	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    1.75  }
    1.76 @@ -557,7 +534,9 @@
    1.77  
    1.78  Client *
    1.79  getnext(Client *c) {
    1.80 -	for(; c && !isvisible(c); c = c->next);
    1.81 +	while(c && !isvisible(c)) {
    1.82 +		c = c->next;
    1.83 +	}
    1.84  	return c;
    1.85  }
    1.86