summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-10-05 19:27:28 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-10-05 19:27:28 +0200
commit10885d349a8426f0a55f34e78a2592267e8e55be (patch)
tree6116c68fcc3ff6efbeb5c398d15e3ff5f2028930
parentsmall boundary check fix (diff)
downloaddwm-10885d349a8426f0a55f34e78a2592267e8e55be.tar.gz
dwm-10885d349a8426f0a55f34e78a2592267e8e55be.zip
removed the stack position stuff
-rw-r--r--config.arg.h11
-rw-r--r--config.default.h11
-rw-r--r--draw.c4
-rw-r--r--dwm.16
-rw-r--r--dwm.h6
-rw-r--r--event.c8
-rw-r--r--main.c5
-rw-r--r--view.c71
8 files changed, 26 insertions, 96 deletions
diff --git a/config.arg.h b/config.arg.h
index a7d0a81..254d662 100644
--- a/config.arg.h
+++ b/config.arg.h
@@ -8,9 +8,7 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL };
8 8
9#define DEFMODE dotile /* dofloat */ 9#define DEFMODE dotile /* dofloat */
10#define FLOATSYMBOL "><>" 10#define FLOATSYMBOL "><>"
11#define STACKPOS StackRight /* StackLeft */ 11#define TILESYMBOL "[]="
12#define BSTACKSYMBOL "==="
13#define VSTACKSYMBOL "[]="
14 12
15#define FONT "-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*" 13#define FONT "-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*"
16#define NORMBGCOLOR "#333333" 14#define NORMBGCOLOR "#333333"
@@ -20,7 +18,7 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL };
20#define STATUSBGCOLOR "#222222" 18#define STATUSBGCOLOR "#222222"
21#define STATUSFGCOLOR "#9999cc" 19#define STATUSFGCOLOR "#9999cc"
22 20
23#define MASTER 600 /* per mill */ 21#define MASTER 600 /* per thousand */
24#define MODKEY Mod1Mask 22#define MODKEY Mod1Mask
25 23
26#define KEYS \ 24#define KEYS \
@@ -36,9 +34,8 @@ static Key key[] = { \
36 { MODKEY, XK_j, focusnext, { 0 } }, \ 34 { MODKEY, XK_j, focusnext, { 0 } }, \
37 { MODKEY, XK_k, focusprev, { 0 } }, \ 35 { MODKEY, XK_k, focusprev, { 0 } }, \
38 { MODKEY, XK_Return, zoom, { 0 } }, \ 36 { MODKEY, XK_Return, zoom, { 0 } }, \
39 { MODKEY, XK_b, togglestackpos, { 0 } }, \ 37 { MODKEY, XK_g, resizecol, { .i = 15 } }, \
40 { MODKEY, XK_g, resizecol, { .i = 10 } }, \ 38 { MODKEY, XK_s, resizecol, { .i = -15 } }, \
41 { MODKEY, XK_s, resizecol, { .i = -10 } }, \
42 { MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \ 39 { MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
43 { MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \ 40 { MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
44 { MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \ 41 { MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
diff --git a/config.default.h b/config.default.h
index 84713c1..9a6fbc6 100644
--- a/config.default.h
+++ b/config.default.h
@@ -8,9 +8,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL };
8 8
9#define DEFMODE dotile /* dofloat */ 9#define DEFMODE dotile /* dofloat */
10#define FLOATSYMBOL "><>" 10#define FLOATSYMBOL "><>"
11#define STACKPOS StackRight /* StackLeft */ 11#define TILESYMBOL "[]="
12#define BSTACKSYMBOL "==="
13#define VSTACKSYMBOL "[]="
14 12
15#define FONT "fixed" 13#define FONT "fixed"
16#define NORMBGCOLOR "#333366" 14#define NORMBGCOLOR "#333366"
@@ -20,7 +18,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL };
20#define STATUSBGCOLOR "#dddddd" 18#define STATUSBGCOLOR "#dddddd"
21#define STATUSFGCOLOR "#222222" 19#define STATUSFGCOLOR "#222222"
22 20
23#define MASTER 600 /* per mill */ 21#define MASTER 600 /* per thousand */
24#define MODKEY Mod1Mask 22#define MODKEY Mod1Mask
25 23
26#define KEYS \ 24#define KEYS \
@@ -30,9 +28,8 @@ static Key key[] = { \
30 { MODKEY, XK_Tab, focusnext, { 0 } }, \ 28 { MODKEY, XK_Tab, focusnext, { 0 } }, \
31 { MODKEY|ShiftMask, XK_Tab, focusprev, { 0 } }, \ 29 { MODKEY|ShiftMask, XK_Tab, focusprev, { 0 } }, \
32 { MODKEY, XK_Return, zoom, { 0 } }, \ 30 { MODKEY, XK_Return, zoom, { 0 } }, \
33 { MODKEY, XK_b, togglestackpos, { 0 } }, \ 31 { MODKEY, XK_g, resizecol, { .i = 15 } }, \
34 { MODKEY, XK_g, resizecol, { .i = 10 } }, \ 32 { MODKEY, XK_s, resizecol, { .i = -15 } }, \
35 { MODKEY, XK_s, resizecol, { .i = -10 } }, \
36 { MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \ 33 { MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
37 { MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \ 34 { MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
38 { MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \ 35 { MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
diff --git a/draw.c b/draw.c
index bbcfadb..c5cd35b 100644
--- a/draw.c
+++ b/draw.c
@@ -104,9 +104,7 @@ drawstatus(void) {
104 } 104 }
105 105
106 dc.w = bmw; 106 dc.w = bmw;
107 drawtext(arrange == dofloat ? 107 drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False);
108 FLOATSYMBOL : stackpos == StackBottom ?
109 BSTACKSYMBOL : VSTACKSYMBOL, dc.status, False);
110 108
111 x = dc.x + dc.w; 109 x = dc.x + dc.w;
112 dc.w = textw(stext); 110 dc.w = textw(stext);
diff --git a/dwm.1 b/dwm.1
index 91398ee..eb396e7 100644
--- a/dwm.1
+++ b/dwm.1
@@ -40,8 +40,7 @@ click on a tag label to display all windows with that tag, click on the mode
40label toggles between tiling and floating mode. 40label toggles between tiling and floating mode.
41.TP 41.TP
42.B Button3 42.B Button3
43click on a tag label adds/removes all windows with that tag to/from the view, 43click on a tag label adds/removes all windows with that tag to/from the view.
44click on the mode label toggles the stack position (tiling mode).
45.TP 44.TP
46.B Mod1-Button1 45.B Mod1-Button1
47click on a tag label applies that tag to the focused window. 46click on a tag label applies that tag to the focused window.
@@ -63,9 +62,6 @@ Focus previous window.
63.B Mod1-Return 62.B Mod1-Return
64Zooms/cycles current window to/from master area (tiling mode), toggles maximization current window (floating mode). 63Zooms/cycles current window to/from master area (tiling mode), toggles maximization current window (floating mode).
65.TP 64.TP
66.B Mod1-b
67Toggle stack position (tiling mode only).
68.TP
69.B Mod1-g 65.B Mod1-g
70Grow current area (tiling mode only). 66Grow current area (tiling mode only).
71.TP 67.TP
diff --git a/dwm.h b/dwm.h
index 191474d..0d00c25 100644
--- a/dwm.h
+++ b/dwm.h
@@ -48,10 +48,6 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
48enum { ColFG, ColBG, ColLast }; /* color */ 48enum { ColFG, ColBG, ColLast }; /* color */
49 49
50typedef enum { 50typedef enum {
51 StackLeft, StackBottom, StackRight
52} StackPos; /* stack position*/
53
54typedef enum {
55 TopLeft, TopRight, BotLeft, BotRight 51 TopLeft, TopRight, BotLeft, BotRight
56} Corner; /* window corners */ 52} Corner; /* window corners */
57 53
@@ -111,7 +107,6 @@ extern Client *clients, *sel, *stack; /* global client list and stack */
111extern Cursor cursor[CurLast]; 107extern Cursor cursor[CurLast];
112extern DC dc; /* global draw context */ 108extern DC dc; /* global draw context */
113extern Display *dpy; 109extern Display *dpy;
114extern StackPos stackpos;
115extern Window root, barwin; 110extern Window root, barwin;
116 111
117/* client.c */ 112/* client.c */
@@ -170,7 +165,6 @@ extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ign
170extern Bool isvisible(Client *c); /* returns True if client is visible */ 165extern Bool isvisible(Client *c); /* returns True if client is visible */
171extern void resizecol(Arg *arg); /* resizes the master percent with arg's index value */ 166extern void resizecol(Arg *arg); /* resizes the master percent with arg's index value */
172extern void restack(void); /* restores z layers of all clients */ 167extern void restack(void); /* restores z layers of all clients */
173extern void togglestackpos(Arg *arg); /* toggles stack position */
174extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ 168extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */
175extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ 169extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */
176extern void view(Arg *arg); /* views the tag with arg's index */ 170extern void view(Arg *arg); /* views the tag with arg's index */
diff --git a/event.c b/event.c
index a17034c..eab9b12 100644
--- a/event.c
+++ b/event.c
@@ -123,12 +123,8 @@ buttonpress(XEvent *e) {
123 return; 123 return;
124 } 124 }
125 } 125 }
126 if(ev->x < x + bmw) { 126 if((ev->x < x + bmw) && (ev->button == Button1))
127 if(ev->button == Button1) 127 togglemode(NULL);
128 togglemode(NULL);
129 else if(ev->button == Button3)
130 togglestackpos(NULL);
131 }
132 } 128 }
133 else if((c = getclient(ev->window))) { 129 else if((c = getclient(ev->window))) {
134 focus(c); 130 focus(c);
diff --git a/main.c b/main.c
index 53a7c3c..b627e51 100644
--- a/main.c
+++ b/main.c
@@ -129,10 +129,7 @@ setup(void) {
129 dc.status[ColFG] = getcolor(STATUSFGCOLOR); 129 dc.status[ColFG] = getcolor(STATUSFGCOLOR);
130 setfont(FONT); 130 setfont(FONT);
131 131
132 bmw = textw(VSTACKSYMBOL) > textw(BSTACKSYMBOL) ? 132 bmw = textw(TILESYMBOL) > textw(FLOATSYMBOL) ? textw(TILESYMBOL) : textw(FLOATSYMBOL);
133 textw(VSTACKSYMBOL) : textw(BSTACKSYMBOL);
134 bmw = bmw > textw(FLOATSYMBOL) ?
135 bmw : textw(FLOATSYMBOL);
136 sx = sy = 0; 133 sx = sy = 0;
137 sw = DisplayWidth(dpy, screen); 134 sw = DisplayWidth(dpy, screen);
138 sh = DisplayHeight(dpy, screen); 135 sh = DisplayHeight(dpy, screen);
diff --git a/view.c b/view.c
index 70b0253..0f9cb68 100644
--- a/view.c
+++ b/view.c
@@ -65,7 +65,6 @@ togglemax(Client *c)
65/* extern */ 65/* extern */
66 66
67void (*arrange)(Arg *) = DEFMODE; 67void (*arrange)(Arg *) = DEFMODE;
68StackPos stackpos = STACKPOS;
69 68
70void 69void
71detach(Client *c) { 70detach(Client *c) {
@@ -103,28 +102,19 @@ dofloat(Arg *arg) {
103 */ 102 */
104void 103void
105dotile(Arg *arg) { 104dotile(Arg *arg) {
106 unsigned int i, n, md, stackw, stackh, tw, th; 105 unsigned int i, n, md, stackw, stackh, th;
107 Client *c; 106 Client *c;
108 107
109 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) 108 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
110 n++; 109 n++;
111 110
112 if(stackpos == StackBottom) { 111 md = (sw * master) / 1000;
113 md = ((sh - bh) * master) / 1000; 112 stackw = sw - md;
114 stackw = sw; 113 stackh = sh - bh;
115 stackh = sh - bh - md;
116 }
117 else {
118 md = (sw * master) / 1000;
119 stackw = sw - md;
120 stackh = sh - bh;
121 }
122 114
123 tw = stackw; 115 th = stackh;
124 if(n > 1) 116 if(n > 1)
125 th = stackh / (n - 1); 117 th /= (n - 1);
126 else
127 th = stackh;
128 118
129 for(i = 0, c = clients; c; c = c->next) { 119 for(i = 0, c = clients; c; c = c->next) {
130 if(isvisible(c)) { 120 if(isvisible(c)) {
@@ -140,43 +130,19 @@ dotile(Arg *arg) {
140 c->h = sh - 2 * BORDERPX - bh; 130 c->h = sh - 2 * BORDERPX - bh;
141 } 131 }
142 else if(i == 0) { /* master window */ 132 else if(i == 0) { /* master window */
143 if(stackpos == StackLeft) 133 c->w = md - 2 * BORDERPX;
144 c->x += stackw; 134 c->h = sh - bh - 2 * BORDERPX;
145 switch(stackpos) {
146 case StackLeft:
147 case StackRight:
148 c->w = md - 2 * BORDERPX;
149 c->h = sh - bh - 2 * BORDERPX;
150 break;
151 case StackBottom:
152 c->w = sw - 2 * BORDERPX;
153 c->h = md - 2 * BORDERPX;
154 break;
155 }
156 } 135 }
157 else { /* tile window */ 136 else { /* tile window */
158 if(stackpos == StackRight) 137 c->x += md;
159 c->x += md;
160 if(th > bh) { 138 if(th > bh) {
161 switch(stackpos) { 139 c->y = sy + (i - 1) * th + bh;
162 case StackLeft: 140 if(i + 1 == n)
163 case StackRight: 141 c->h = sh - c->y - 2 * BORDERPX;
164 c->y = sy + (i - 1) * th + bh; 142 c->w = stackw - 2 * BORDERPX;
165 if(i + 1 == n)
166 c->h = sh - c->y - 2 * BORDERPX;
167 break;
168 case StackBottom:
169 c->y = sy + md + (i - 1) * th + bh;
170 if(i + 1 == n)
171 c->h = sh - c->y - 2 * BORDERPX;
172 break;
173 }
174 c->w = tw - 2 * BORDERPX;
175 c->h = th - 2 * BORDERPX; 143 c->h = th - 2 * BORDERPX;
176 } 144 }
177 else { /* fallback if th < bh */ 145 else { /* fallback if th < bh */
178 if(stackpos == StackBottom)
179 c->y += md;
180 c->w = stackw - 2 * BORDERPX; 146 c->w = stackw - 2 * BORDERPX;
181 c->h = stackh - 2 * BORDERPX; 147 c->h = stackh - 2 * BORDERPX;
182 } 148 }
@@ -312,17 +278,6 @@ toggleview(Arg *arg) {
312} 278}
313 279
314void 280void
315togglestackpos(Arg *arg) {
316 if(arrange == dofloat)
317 return;
318 if(stackpos == StackBottom)
319 stackpos = STACKPOS;
320 else
321 stackpos = StackBottom;
322 arrange(NULL);
323}
324
325void
326view(Arg *arg) { 281view(Arg *arg) {
327 unsigned int i; 282 unsigned int i;
328 283