removed the direction flipping 36178933
Anselm R. Garbe · 2006-09-29 17:02 4 file(s) · +18 −66
config.arg.h +0 −2
10 10
#define FLOATSYMBOL		"><>"
11 11
#define STACKPOS		StackRight	/* StackLeft */
12 12
#define TILESYMBOL		"[]="
13 -
#define VERTICALSTACK		True		/* False == horizontal stack  */
14 13
15 14
#define FONT			"-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*"
16 15
#define NORMBGCOLOR		"#333333"
37 36
	{ MODKEY,			XK_k,		focusprev,	{ 0 } }, \
38 37
	{ MODKEY,			XK_Return,	zoom,		{ 0 } }, \
39 38
	{ MODKEY,			XK_b,		togglestackpos,	{ 0 } }, \
40 -
	{ MODKEY,			XK_d,		togglestackdir,	{ 0 } }, \
41 39
	{ MODKEY,			XK_g,		resizecol,	{ .i = 20 } }, \
42 40
	{ MODKEY,			XK_s,		resizecol,	{ .i = -20 } }, \
43 41
	{ MODKEY|ShiftMask,		XK_1,		tag,		{ .i = 0 } }, \
config.default.h +0 −2
10 10
#define FLOATSYMBOL		"><>"
11 11
#define STACKPOS		StackRight	/* StackLeft */
12 12
#define TILESYMBOL		"[]="
13 -
#define VERTICALSTACK		True		/* False == horizontal stack  */
14 13
15 14
#define FONT			"fixed"
16 15
#define NORMBGCOLOR		"#333366"
31 30
	{ MODKEY|ShiftMask,		XK_Tab,		focusprev,	{ 0 } }, \
32 31
	{ MODKEY,			XK_Return,	zoom,		{ 0 } }, \
33 32
	{ MODKEY,			XK_b,		togglestackpos,	{ 0 } }, \
34 -
	{ MODKEY,			XK_d,		togglestackdir,	{ 0 } }, \
35 33
	{ MODKEY,			XK_g,		resizecol,	{ .i = 20 } }, \
36 34
	{ MODKEY,			XK_s,		resizecol,	{ .i = -20 } }, \
37 35
	{ MODKEY|ShiftMask,		XK_1,		tag,		{ .i = 0 } }, \
dwm.h +0 −2
108 108
extern void (*arrange)(Arg *);			/* arrange function, indicates mode  */
109 109
extern Atom wmatom[WMLast], netatom[NetLast];
110 110
extern Bool running, issel, *seltag;		/* seltag is array of Bool */
111 -
extern Bool isvertical;				/* stack direction */
112 111
extern Client *clients, *sel, *stack;		/* global client list and stack */
113 112
extern Cursor cursor[CurLast];
114 113
extern DC dc;					/* global draw context */
172 171
extern Bool isvisible(Client *c);		/* returns True if client is visible */
173 172
extern void resizecol(Arg *arg);		/* resizes the master dimension with arg's index value */
174 173
extern void restack(void);			/* restores z layers of all clients */
175 -
extern void togglestackdir(Arg *arg);		/* toggles stack direction */
176 174
extern void togglestackpos(Arg *arg);		/* toggles stack position */
177 175
extern void togglemode(Arg *arg);		/* toggles global arrange function (dotile/dofloat) */
178 176
extern void toggleview(Arg *arg);		/* toggles the tag with arg's index (in)visible */
view.c +18 −60
65 65
/* extern */
66 66
67 67
void (*arrange)(Arg *) = DEFMODE;
68 -
Bool isvertical = VERTICALSTACK;
69 68
StackPos stackpos = STACKPOS;
70 69
71 70
void
119 118
		stackh = sh - bh;
120 119
	}
121 120
122 -
	if(isvertical) {
123 -
		tw = stackw;
124 -
		if(n > 1)
125 -
			th = stackh / (n - 1);
126 -
		else
127 -
			th = stackh;
128 -
	}
129 -
	else {
121 +
	tw = stackw;
122 +
	if(n > 1)
123 +
		th = stackh / (n - 1);
124 +
	else
130 125
		th = stackh;
131 -
		if(n > 1)
132 -
			tw = stackw / (n - 1);
133 -
		else
134 -
			tw = stackw;
135 -
	}
136 126
137 127
	for(i = 0, c = clients; c; c = c->next) {
138 128
		if(isvisible(c)) {
169 159
					break;
170 160
				}
171 161
			}
172 -
			else if((isvertical && th > bh) || (!isvertical && tw > MINW)) {
162 +
			else if(th > bh) {
173 163
				/* tile window */
174 164
				c->w = tw - 2 * BORDERPX;
175 165
				c->h = th - 2 * BORDERPX;
176 166
				switch(stackpos) {
177 167
				case StackLeft:
178 -
					if(isvertical) {
179 -
						c->x = sx;
180 -
						c->y = sy + (i - 1) * th + bh;
181 -
						if(i + 1 == n)
182 -
							c->h = sh - c->y - 2 * BORDERPX;
183 -
					}
184 -
					else {
185 -
						c->x = sx + (i - 1) * tw;
186 -
						c->y = sy + bh;
187 -
						if(i + 1 == n)
188 -
							c->w = sx + stackw - c->x - 2 * BORDERPX;
189 -
					}
168 +
					c->x = sx;
169 +
					c->y = sy + (i - 1) * th + bh;
170 +
					if(i + 1 == n)
171 +
						c->h = sh - c->y - 2 * BORDERPX;
190 172
					break;
191 173
				case StackBottom:
192 -
					if(isvertical) {
193 -
						c->x = sx;
194 -
						c->y = sy + master + (i - 1) * th + bh;
195 -
						if(i + 1 == n)
196 -
							c->h = sh - c->y - 2 * BORDERPX;
197 -
					}
198 -
					else {
199 -
						c->x = sx + (i - 1) * tw;
200 -
						c->y = sy + bh + master;
201 -
						if(i + 1 == n)
202 -
							c->w = sw - c->x - 2 * BORDERPX;
203 -
					}
174 +
					c->x = sx;
175 +
					c->y = sy + master + (i - 1) * th + bh;
176 +
					if(i + 1 == n)
177 +
						c->h = sh - c->y - 2 * BORDERPX;
204 178
					break;
205 179
				case StackRight:
206 -
					if(isvertical) {
207 -
						c->x = sx + master;
208 -
						c->y = sy + (i - 1) * th + bh;
209 -
						if(i + 1 == n)
210 -
							c->h = sh - c->y - 2 * BORDERPX;
211 -
					}
212 -
					else {
213 -
						c->x = sx + master + (i - 1) * tw;
214 -
						c->y = sy + bh;
215 -
						if(i + 1 == n)
216 -
							c->w = sw - c->x - 2 * BORDERPX;
217 -
					}
180 +
					c->x = sx + master;
181 +
					c->y = sy + (i - 1) * th + bh;
182 +
					if(i + 1 == n)
183 +
						c->h = sh - c->y - 2 * BORDERPX;
218 184
					break;
219 185
				}
220 186
			}
221 -
			else { /* fallback if th < bh resp. tw < MINW */
187 +
			else { /* fallback if th < bh */
222 188
				c->w = stackw - 2 * BORDERPX;
223 189
				c->h = stackh - 2 * BORDERPX;
224 190
				switch(stackpos) {
356 322
	if(i == ntags)
357 323
		seltag[arg->i] = True; /* cannot toggle last view */
358 324
	reorder();
359 -
	arrange(NULL);
360 -
}
361 -
362 -
void
363 -
togglestackdir(Arg *arg) {
364 -
	if(arrange == dofloat)
365 -
		return;
366 -
	isvertical = !isvertical;
367 325
	arrange(NULL);
368 326
}
369 327