dwm-meillo

diff view.c @ 530:451f19d48845

removed the stack position stuff
author Anselm R. Garbe <arg@10kloc.org>
date Thu, 05 Oct 2006 19:27:28 +0200
parents e2bd83191fc6
children 96563762b4ad
line diff
     1.1 --- a/view.c	Thu Oct 05 18:23:28 2006 +0200
     1.2 +++ b/view.c	Thu Oct 05 19:27:28 2006 +0200
     1.3 @@ -65,7 +65,6 @@
     1.4  /* extern */
     1.5  
     1.6  void (*arrange)(Arg *) = DEFMODE;
     1.7 -StackPos stackpos = STACKPOS;
     1.8  
     1.9  void
    1.10  detach(Client *c) {
    1.11 @@ -103,28 +102,19 @@
    1.12   */
    1.13  void
    1.14  dotile(Arg *arg) {
    1.15 -	unsigned int i, n, md, stackw, stackh, tw, th;
    1.16 +	unsigned int i, n, md, stackw, stackh, th;
    1.17  	Client *c;
    1.18  
    1.19  	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
    1.20  		n++;
    1.21  
    1.22 -	if(stackpos == StackBottom) {
    1.23 -		md = ((sh - bh) * master) / 1000;
    1.24 -		stackw = sw;
    1.25 -		stackh = sh - bh - md;
    1.26 -	}
    1.27 -	else {
    1.28 -		md = (sw * master) / 1000;
    1.29 -		stackw = sw - md;
    1.30 -		stackh = sh - bh;
    1.31 -	}
    1.32 +	md = (sw * master) / 1000;
    1.33 +	stackw = sw - md;
    1.34 +	stackh = sh - bh;
    1.35  
    1.36 -	tw = stackw;
    1.37 +	th = stackh;
    1.38  	if(n > 1)
    1.39 -		th = stackh / (n - 1);
    1.40 -	else
    1.41 -		th = stackh;
    1.42 +		th /= (n - 1);
    1.43  
    1.44  	for(i = 0, c = clients; c; c = c->next) {
    1.45  		if(isvisible(c)) {
    1.46 @@ -140,43 +130,19 @@
    1.47  				c->h = sh - 2 * BORDERPX - bh;
    1.48  			}
    1.49  			else if(i == 0) { /* master window */
    1.50 -				if(stackpos == StackLeft)
    1.51 -					c->x += stackw;
    1.52 -				switch(stackpos) {
    1.53 -				case StackLeft:
    1.54 -				case StackRight:
    1.55 -					c->w = md - 2 * BORDERPX;
    1.56 -					c->h = sh - bh - 2 * BORDERPX;
    1.57 -					break;
    1.58 -				case StackBottom:
    1.59 -					c->w = sw - 2 * BORDERPX;
    1.60 -					c->h = md - 2 * BORDERPX;
    1.61 -					break;
    1.62 -				}
    1.63 +				c->w = md - 2 * BORDERPX;
    1.64 +				c->h = sh - bh - 2 * BORDERPX;
    1.65  			}
    1.66  			else {  /* tile window */
    1.67 -				if(stackpos == StackRight)
    1.68 -					c->x += md;
    1.69 +				c->x += md;
    1.70  				if(th > bh) {
    1.71 -					switch(stackpos) {
    1.72 -					case StackLeft:
    1.73 -					case StackRight:
    1.74 -						c->y = sy + (i - 1) * th + bh;
    1.75 -						if(i + 1 == n)
    1.76 -							c->h = sh - c->y - 2 * BORDERPX;
    1.77 -						break;
    1.78 -					case StackBottom:
    1.79 -						c->y = sy + md + (i - 1) * th + bh;
    1.80 -						if(i + 1 == n)
    1.81 -							c->h = sh - c->y - 2 * BORDERPX;
    1.82 -						break;
    1.83 -					}
    1.84 -					c->w = tw - 2 * BORDERPX;
    1.85 +					c->y = sy + (i - 1) * th + bh;
    1.86 +					if(i + 1 == n)
    1.87 +						c->h = sh - c->y - 2 * BORDERPX;
    1.88 +					c->w = stackw - 2 * BORDERPX;
    1.89  					c->h = th - 2 * BORDERPX;
    1.90  				}
    1.91  				else { /* fallback if th < bh */
    1.92 -					if(stackpos == StackBottom)
    1.93 -						c->y += md;
    1.94  					c->w = stackw - 2 * BORDERPX;
    1.95  					c->h = stackh - 2 * BORDERPX;
    1.96  				}
    1.97 @@ -312,17 +278,6 @@
    1.98  }
    1.99  
   1.100  void
   1.101 -togglestackpos(Arg *arg) {
   1.102 -	if(arrange == dofloat)
   1.103 -		return;
   1.104 -	if(stackpos == StackBottom)
   1.105 -		stackpos = STACKPOS;
   1.106 -	else
   1.107 -		stackpos = StackBottom;
   1.108 -	arrange(NULL);
   1.109 -}
   1.110 -
   1.111 -void
   1.112  view(Arg *arg) {
   1.113  	unsigned int i;
   1.114