removed the direction flipping
authorAnselm R. Garbe <arg@10kloc.org>
Fri, 29 Sep 2006 17:02:56 +0200
changeset 511 1599c953647b
parent 510 0dfa6b752aed
child 512 aca04c3022c1
removed the direction flipping
config.arg.h
config.default.h
dwm.h
view.c
--- a/config.arg.h	Fri Sep 29 16:54:15 2006 +0200
+++ b/config.arg.h	Fri Sep 29 17:02:56 2006 +0200
@@ -10,7 +10,6 @@
 #define FLOATSYMBOL		"><>"
 #define STACKPOS		StackRight	/* StackLeft */
 #define TILESYMBOL		"[]="
-#define VERTICALSTACK		True		/* False == horizontal stack  */
 
 #define FONT			"-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*"
 #define NORMBGCOLOR		"#333333"
@@ -37,7 +36,6 @@
 	{ MODKEY,			XK_k,		focusprev,	{ 0 } }, \
 	{ MODKEY,			XK_Return,	zoom,		{ 0 } }, \
 	{ MODKEY,			XK_b,		togglestackpos,	{ 0 } }, \
-	{ MODKEY,			XK_d,		togglestackdir,	{ 0 } }, \
 	{ MODKEY,			XK_g,		resizecol,	{ .i = 20 } }, \
 	{ MODKEY,			XK_s,		resizecol,	{ .i = -20 } }, \
 	{ MODKEY|ShiftMask,		XK_1,		tag,		{ .i = 0 } }, \
--- a/config.default.h	Fri Sep 29 16:54:15 2006 +0200
+++ b/config.default.h	Fri Sep 29 17:02:56 2006 +0200
@@ -10,7 +10,6 @@
 #define FLOATSYMBOL		"><>"
 #define STACKPOS		StackRight	/* StackLeft */
 #define TILESYMBOL		"[]="
-#define VERTICALSTACK		True		/* False == horizontal stack  */
 
 #define FONT			"fixed"
 #define NORMBGCOLOR		"#333366"
@@ -31,7 +30,6 @@
 	{ MODKEY|ShiftMask,		XK_Tab,		focusprev,	{ 0 } }, \
 	{ MODKEY,			XK_Return,	zoom,		{ 0 } }, \
 	{ MODKEY,			XK_b,		togglestackpos,	{ 0 } }, \
-	{ MODKEY,			XK_d,		togglestackdir,	{ 0 } }, \
 	{ MODKEY,			XK_g,		resizecol,	{ .i = 20 } }, \
 	{ MODKEY,			XK_s,		resizecol,	{ .i = -20 } }, \
 	{ MODKEY|ShiftMask,		XK_1,		tag,		{ .i = 0 } }, \
--- a/dwm.h	Fri Sep 29 16:54:15 2006 +0200
+++ b/dwm.h	Fri Sep 29 17:02:56 2006 +0200
@@ -108,7 +108,6 @@
 extern void (*arrange)(Arg *);			/* arrange function, indicates mode  */
 extern Atom wmatom[WMLast], netatom[NetLast];
 extern Bool running, issel, *seltag;		/* seltag is array of Bool */
-extern Bool isvertical;				/* stack direction */
 extern Client *clients, *sel, *stack;		/* global client list and stack */
 extern Cursor cursor[CurLast];
 extern DC dc;					/* global draw context */
@@ -172,7 +171,6 @@
 extern Bool isvisible(Client *c);		/* returns True if client is visible */
 extern void resizecol(Arg *arg);		/* resizes the master dimension with arg's index value */
 extern void restack(void);			/* restores z layers of all clients */
-extern void togglestackdir(Arg *arg);		/* toggles stack direction */
 extern void togglestackpos(Arg *arg);		/* toggles stack position */
 extern void togglemode(Arg *arg);		/* toggles global arrange function (dotile/dofloat) */
 extern void toggleview(Arg *arg);		/* toggles the tag with arg's index (in)visible */
--- a/view.c	Fri Sep 29 16:54:15 2006 +0200
+++ b/view.c	Fri Sep 29 17:02:56 2006 +0200
@@ -65,7 +65,6 @@
 /* extern */
 
 void (*arrange)(Arg *) = DEFMODE;
-Bool isvertical = VERTICALSTACK;
 StackPos stackpos = STACKPOS;
 
 void
@@ -119,20 +118,11 @@
 		stackh = sh - bh;
 	}
 
-	if(isvertical) {
-		tw = stackw;
-		if(n > 1)
-			th = stackh / (n - 1);
-		else
-			th = stackh;
-	}
-	else {
+	tw = stackw;
+	if(n > 1)
+		th = stackh / (n - 1);
+	else
 		th = stackh;
-		if(n > 1)
-			tw = stackw / (n - 1);
-		else
-			tw = stackw;
-	}
 
 	for(i = 0, c = clients; c; c = c->next) {
 		if(isvisible(c)) {
@@ -169,56 +159,32 @@
 					break;
 				}
 			}
-			else if((isvertical && th > bh) || (!isvertical && tw > MINW)) {
+			else if(th > bh) {
 				/* tile window */
 				c->w = tw - 2 * BORDERPX;
 				c->h = th - 2 * BORDERPX;
 				switch(stackpos) {
 				case StackLeft:
-					if(isvertical) {
-						c->x = sx;
-						c->y = sy + (i - 1) * th + bh;
-						if(i + 1 == n)
-							c->h = sh - c->y - 2 * BORDERPX;
-					}
-					else {
-						c->x = sx + (i - 1) * tw;
-						c->y = sy + bh;
-						if(i + 1 == n)
-							c->w = sx + stackw - c->x - 2 * BORDERPX;
-					}
+					c->x = sx;
+					c->y = sy + (i - 1) * th + bh;
+					if(i + 1 == n)
+						c->h = sh - c->y - 2 * BORDERPX;
 					break;
 				case StackBottom:
-					if(isvertical) {
-						c->x = sx;
-						c->y = sy + master + (i - 1) * th + bh;
-						if(i + 1 == n)
-							c->h = sh - c->y - 2 * BORDERPX;
-					}
-					else {
-						c->x = sx + (i - 1) * tw;
-						c->y = sy + bh + master;
-						if(i + 1 == n)
-							c->w = sw - c->x - 2 * BORDERPX;
-					}
+					c->x = sx;
+					c->y = sy + master + (i - 1) * th + bh;
+					if(i + 1 == n)
+						c->h = sh - c->y - 2 * BORDERPX;
 					break;
 				case StackRight:
-					if(isvertical) {
-						c->x = sx + master;
-						c->y = sy + (i - 1) * th + bh;
-						if(i + 1 == n)
-							c->h = sh - c->y - 2 * BORDERPX;
-					}
-					else {
-						c->x = sx + master + (i - 1) * tw;
-						c->y = sy + bh;
-						if(i + 1 == n)
-							c->w = sw - c->x - 2 * BORDERPX;
-					}
+					c->x = sx + master;
+					c->y = sy + (i - 1) * th + bh;
+					if(i + 1 == n)
+						c->h = sh - c->y - 2 * BORDERPX;
 					break;
 				}
 			}
-			else { /* fallback if th < bh resp. tw < MINW */
+			else { /* fallback if th < bh */
 				c->w = stackw - 2 * BORDERPX;
 				c->h = stackh - 2 * BORDERPX;
 				switch(stackpos) {
@@ -360,14 +326,6 @@
 }
 
 void
-togglestackdir(Arg *arg) {
-	if(arrange == dofloat)
-		return;
-	isvertical = !isvertical;
-	arrange(NULL);
-}
-
-void
 togglestackpos(Arg *arg) {
 	if(arrange == dofloat)
 		return;