From 36178933ed53857d59046278afb25b7525cafb39 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Fri, 29 Sep 2006 17:02:56 +0200 Subject: removed the direction flipping --- config.arg.h | 2 -- config.default.h | 2 -- dwm.h | 2 -- view.c | 78 +++++++++++++------------------------------------------- 4 files changed, 18 insertions(+), 66 deletions(-) diff --git a/config.arg.h b/config.arg.h index 03f9c9a..1e6a670 100644 --- a/config.arg.h +++ b/config.arg.h @@ -10,7 +10,6 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL }; #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 @@ static Key key[] = { \ { 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 } }, \ diff --git a/config.default.h b/config.default.h index 4f6a2e2..8075110 100644 --- a/config.default.h +++ b/config.default.h @@ -10,7 +10,6 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL }; #define FLOATSYMBOL "><>" #define STACKPOS StackRight /* StackLeft */ #define TILESYMBOL "[]=" -#define VERTICALSTACK True /* False == horizontal stack */ #define FONT "fixed" #define NORMBGCOLOR "#333366" @@ -31,7 +30,6 @@ static Key key[] = { \ { 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 } }, \ diff --git a/dwm.h b/dwm.h index 4b85ea7..ba50bf6 100644 --- a/dwm.h +++ b/dwm.h @@ -108,7 +108,6 @@ extern void (*handler[LASTEvent])(XEvent *); /* event handler */ 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 void focusprev(Arg *arg); /* focuses previous visible client, arg is ign 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 */ diff --git a/view.c b/view.c index 0910077..ac8e7a3 100644 --- a/view.c +++ b/view.c @@ -65,7 +65,6 @@ togglemax(Client *c) /* extern */ void (*arrange)(Arg *) = DEFMODE; -Bool isvertical = VERTICALSTACK; StackPos stackpos = STACKPOS; void @@ -119,20 +118,11 @@ dotile(Arg *arg) { 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 @@ dotile(Arg *arg) { 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) { @@ -359,14 +325,6 @@ toggleview(Arg *arg) { arrange(NULL); } -void -togglestackdir(Arg *arg) { - if(arrange == dofloat) - return; - isvertical = !isvertical; - arrange(NULL); -} - void togglestackpos(Arg *arg) { if(arrange == dofloat) -- cgit 1.4.1-2-gfad0 'n79' href='#n79'>79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320