dwm-meillo

diff view.c @ 749:6692d7e7e156

added maxlayout by mitch, moved config.h to config.meillo.h, some smaller modifications
author meillo@marmaro.de
date Sun, 11 Feb 2007 17:20:22 +0100
parents 0f91934037b0
children
line diff
     1.1 --- a/view.c	Sun Feb 11 12:20:54 2007 +0100
     1.2 +++ b/view.c	Sun Feb 11 17:20:22 2007 +0100
     1.3 @@ -117,6 +117,48 @@
     1.4  	restack();
     1.5  }
     1.6  
     1.7 +/* begin code by mitch */
     1.8 +void
     1.9 +arrangemax(Client *c) {
    1.10 +  if(c == sel) {
    1.11 +    c->ismax = True;
    1.12 +    c->x = sx;
    1.13 +    c->y = bh;
    1.14 +    c->w = sw - 2 * BORDERPX;
    1.15 +    c->h = sh - bh - 2 * BORDERPX;
    1.16 +    XRaiseWindow(dpy, c->win);
    1.17 +  } else {
    1.18 +    c->ismax = False;
    1.19 +    XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
    1.20 +    XLowerWindow(dpy, c->win);
    1.21 +  }
    1.22 +}
    1.23 + 
    1.24 +void
    1.25 +domax(void) {
    1.26 +  Client *c;
    1.27 +
    1.28 +  for(c = clients; c; c = c->next) {
    1.29 +    if(isvisible(c)) {
    1.30 +      if(c->isfloat) {
    1.31 +        resize(c, True);
    1.32 +        continue;
    1.33 +      }
    1.34 +      arrangemax(c);
    1.35 +      resize(c, False);
    1.36 +    } else {
    1.37 +      XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
    1.38 +    }
    1.39 +
    1.40 +  }
    1.41 +  if(!sel || !isvisible(sel)) {
    1.42 +    for(c = stack; c && !isvisible(c); c = c->snext);
    1.43 +    focus(c);
    1.44 +  }
    1.45 +  restack();
    1.46 +}
    1.47 +/* end code by mitch */
    1.48 +
    1.49  void
    1.50  focusnext(Arg *arg) {
    1.51  	Client *c;
    1.52 @@ -192,7 +234,17 @@
    1.53  		return;
    1.54  	if(sel->isfloat || arrange == dofloat)
    1.55  		XRaiseWindow(dpy, sel->win);
    1.56 -	if(arrange != dofloat) {
    1.57 +
    1.58 +  /* begin code by mitch */
    1.59 +  if(arrange == domax) {
    1.60 +    for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
    1.61 +      arrangemax(c);
    1.62 +      resize(c, False);
    1.63 +    }
    1.64 +
    1.65 +  } else if (arrange == dotile) {
    1.66 +  /* end code by mitch */
    1.67 +
    1.68  		if(!sel->isfloat)
    1.69  			XLowerWindow(dpy, sel->win);
    1.70  		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
    1.71 @@ -215,7 +267,8 @@
    1.72  
    1.73  void
    1.74  togglemode(Arg *arg) {
    1.75 -	arrange = (arrange == dofloat) ? dotile : dofloat;
    1.76 +  /* only toggle between tile and max - float is just available through togglefloat */
    1.77 +  arrange = (arrange == dotile) ? domax : dotile;
    1.78  	if(sel)
    1.79  		arrange();
    1.80  	else