dwm-meillo
changeset 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 |
files | config.arg.h config.default.h draw.c dwm.1 dwm.h event.c main.c view.c |
diffstat | 8 files changed, 26 insertions(+), 96 deletions(-) [+] |
line diff
1.1 --- a/config.arg.h Thu Oct 05 18:23:28 2006 +0200 1.2 +++ b/config.arg.h Thu Oct 05 19:27:28 2006 +0200 1.3 @@ -8,9 +8,7 @@ 1.4 1.5 #define DEFMODE dotile /* dofloat */ 1.6 #define FLOATSYMBOL "><>" 1.7 -#define STACKPOS StackRight /* StackLeft */ 1.8 -#define BSTACKSYMBOL "===" 1.9 -#define VSTACKSYMBOL "[]=" 1.10 +#define TILESYMBOL "[]=" 1.11 1.12 #define FONT "-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*" 1.13 #define NORMBGCOLOR "#333333" 1.14 @@ -20,7 +18,7 @@ 1.15 #define STATUSBGCOLOR "#222222" 1.16 #define STATUSFGCOLOR "#9999cc" 1.17 1.18 -#define MASTER 600 /* per mill */ 1.19 +#define MASTER 600 /* per thousand */ 1.20 #define MODKEY Mod1Mask 1.21 1.22 #define KEYS \ 1.23 @@ -36,9 +34,8 @@ 1.24 { MODKEY, XK_j, focusnext, { 0 } }, \ 1.25 { MODKEY, XK_k, focusprev, { 0 } }, \ 1.26 { MODKEY, XK_Return, zoom, { 0 } }, \ 1.27 - { MODKEY, XK_b, togglestackpos, { 0 } }, \ 1.28 - { MODKEY, XK_g, resizecol, { .i = 10 } }, \ 1.29 - { MODKEY, XK_s, resizecol, { .i = -10 } }, \ 1.30 + { MODKEY, XK_g, resizecol, { .i = 15 } }, \ 1.31 + { MODKEY, XK_s, resizecol, { .i = -15 } }, \ 1.32 { MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \ 1.33 { MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \ 1.34 { MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
2.1 --- a/config.default.h Thu Oct 05 18:23:28 2006 +0200 2.2 +++ b/config.default.h Thu Oct 05 19:27:28 2006 +0200 2.3 @@ -8,9 +8,7 @@ 2.4 2.5 #define DEFMODE dotile /* dofloat */ 2.6 #define FLOATSYMBOL "><>" 2.7 -#define STACKPOS StackRight /* StackLeft */ 2.8 -#define BSTACKSYMBOL "===" 2.9 -#define VSTACKSYMBOL "[]=" 2.10 +#define TILESYMBOL "[]=" 2.11 2.12 #define FONT "fixed" 2.13 #define NORMBGCOLOR "#333366" 2.14 @@ -20,7 +18,7 @@ 2.15 #define STATUSBGCOLOR "#dddddd" 2.16 #define STATUSFGCOLOR "#222222" 2.17 2.18 -#define MASTER 600 /* per mill */ 2.19 +#define MASTER 600 /* per thousand */ 2.20 #define MODKEY Mod1Mask 2.21 2.22 #define KEYS \ 2.23 @@ -30,9 +28,8 @@ 2.24 { MODKEY, XK_Tab, focusnext, { 0 } }, \ 2.25 { MODKEY|ShiftMask, XK_Tab, focusprev, { 0 } }, \ 2.26 { MODKEY, XK_Return, zoom, { 0 } }, \ 2.27 - { MODKEY, XK_b, togglestackpos, { 0 } }, \ 2.28 - { MODKEY, XK_g, resizecol, { .i = 10 } }, \ 2.29 - { MODKEY, XK_s, resizecol, { .i = -10 } }, \ 2.30 + { MODKEY, XK_g, resizecol, { .i = 15 } }, \ 2.31 + { MODKEY, XK_s, resizecol, { .i = -15 } }, \ 2.32 { MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \ 2.33 { MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \ 2.34 { MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
3.1 --- a/draw.c Thu Oct 05 18:23:28 2006 +0200 3.2 +++ b/draw.c Thu Oct 05 19:27:28 2006 +0200 3.3 @@ -104,9 +104,7 @@ 3.4 } 3.5 3.6 dc.w = bmw; 3.7 - drawtext(arrange == dofloat ? 3.8 - FLOATSYMBOL : stackpos == StackBottom ? 3.9 - BSTACKSYMBOL : VSTACKSYMBOL, dc.status, False); 3.10 + drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False); 3.11 3.12 x = dc.x + dc.w; 3.13 dc.w = textw(stext);
4.1 --- a/dwm.1 Thu Oct 05 18:23:28 2006 +0200 4.2 +++ b/dwm.1 Thu Oct 05 19:27:28 2006 +0200 4.3 @@ -40,8 +40,7 @@ 4.4 label toggles between tiling and floating mode. 4.5 .TP 4.6 .B Button3 4.7 -click on a tag label adds/removes all windows with that tag to/from the view, 4.8 -click on the mode label toggles the stack position (tiling mode). 4.9 +click on a tag label adds/removes all windows with that tag to/from the view. 4.10 .TP 4.11 .B Mod1-Button1 4.12 click on a tag label applies that tag to the focused window. 4.13 @@ -63,9 +62,6 @@ 4.14 .B Mod1-Return 4.15 Zooms/cycles current window to/from master area (tiling mode), toggles maximization current window (floating mode). 4.16 .TP 4.17 -.B Mod1-b 4.18 -Toggle stack position (tiling mode only). 4.19 -.TP 4.20 .B Mod1-g 4.21 Grow current area (tiling mode only). 4.22 .TP
5.1 --- a/dwm.h Thu Oct 05 18:23:28 2006 +0200 5.2 +++ b/dwm.h Thu Oct 05 19:27:28 2006 +0200 5.3 @@ -48,10 +48,6 @@ 5.4 enum { ColFG, ColBG, ColLast }; /* color */ 5.5 5.6 typedef enum { 5.7 - StackLeft, StackBottom, StackRight 5.8 -} StackPos; /* stack position*/ 5.9 - 5.10 -typedef enum { 5.11 TopLeft, TopRight, BotLeft, BotRight 5.12 } Corner; /* window corners */ 5.13 5.14 @@ -111,7 +107,6 @@ 5.15 extern Cursor cursor[CurLast]; 5.16 extern DC dc; /* global draw context */ 5.17 extern Display *dpy; 5.18 -extern StackPos stackpos; 5.19 extern Window root, barwin; 5.20 5.21 /* client.c */ 5.22 @@ -170,7 +165,6 @@ 5.23 extern Bool isvisible(Client *c); /* returns True if client is visible */ 5.24 extern void resizecol(Arg *arg); /* resizes the master percent with arg's index value */ 5.25 extern void restack(void); /* restores z layers of all clients */ 5.26 -extern void togglestackpos(Arg *arg); /* toggles stack position */ 5.27 extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ 5.28 extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ 5.29 extern void view(Arg *arg); /* views the tag with arg's index */
6.1 --- a/event.c Thu Oct 05 18:23:28 2006 +0200 6.2 +++ b/event.c Thu Oct 05 19:27:28 2006 +0200 6.3 @@ -123,12 +123,8 @@ 6.4 return; 6.5 } 6.6 } 6.7 - if(ev->x < x + bmw) { 6.8 - if(ev->button == Button1) 6.9 - togglemode(NULL); 6.10 - else if(ev->button == Button3) 6.11 - togglestackpos(NULL); 6.12 - } 6.13 + if((ev->x < x + bmw) && (ev->button == Button1)) 6.14 + togglemode(NULL); 6.15 } 6.16 else if((c = getclient(ev->window))) { 6.17 focus(c);
7.1 --- a/main.c Thu Oct 05 18:23:28 2006 +0200 7.2 +++ b/main.c Thu Oct 05 19:27:28 2006 +0200 7.3 @@ -129,10 +129,7 @@ 7.4 dc.status[ColFG] = getcolor(STATUSFGCOLOR); 7.5 setfont(FONT); 7.6 7.7 - bmw = textw(VSTACKSYMBOL) > textw(BSTACKSYMBOL) ? 7.8 - textw(VSTACKSYMBOL) : textw(BSTACKSYMBOL); 7.9 - bmw = bmw > textw(FLOATSYMBOL) ? 7.10 - bmw : textw(FLOATSYMBOL); 7.11 + bmw = textw(TILESYMBOL) > textw(FLOATSYMBOL) ? textw(TILESYMBOL) : textw(FLOATSYMBOL); 7.12 sx = sy = 0; 7.13 sw = DisplayWidth(dpy, screen); 7.14 sh = DisplayHeight(dpy, screen);
8.1 --- a/view.c Thu Oct 05 18:23:28 2006 +0200 8.2 +++ b/view.c Thu Oct 05 19:27:28 2006 +0200 8.3 @@ -65,7 +65,6 @@ 8.4 /* extern */ 8.5 8.6 void (*arrange)(Arg *) = DEFMODE; 8.7 -StackPos stackpos = STACKPOS; 8.8 8.9 void 8.10 detach(Client *c) { 8.11 @@ -103,28 +102,19 @@ 8.12 */ 8.13 void 8.14 dotile(Arg *arg) { 8.15 - unsigned int i, n, md, stackw, stackh, tw, th; 8.16 + unsigned int i, n, md, stackw, stackh, th; 8.17 Client *c; 8.18 8.19 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) 8.20 n++; 8.21 8.22 - if(stackpos == StackBottom) { 8.23 - md = ((sh - bh) * master) / 1000; 8.24 - stackw = sw; 8.25 - stackh = sh - bh - md; 8.26 - } 8.27 - else { 8.28 - md = (sw * master) / 1000; 8.29 - stackw = sw - md; 8.30 - stackh = sh - bh; 8.31 - } 8.32 + md = (sw * master) / 1000; 8.33 + stackw = sw - md; 8.34 + stackh = sh - bh; 8.35 8.36 - tw = stackw; 8.37 + th = stackh; 8.38 if(n > 1) 8.39 - th = stackh / (n - 1); 8.40 - else 8.41 - th = stackh; 8.42 + th /= (n - 1); 8.43 8.44 for(i = 0, c = clients; c; c = c->next) { 8.45 if(isvisible(c)) { 8.46 @@ -140,43 +130,19 @@ 8.47 c->h = sh - 2 * BORDERPX - bh; 8.48 } 8.49 else if(i == 0) { /* master window */ 8.50 - if(stackpos == StackLeft) 8.51 - c->x += stackw; 8.52 - switch(stackpos) { 8.53 - case StackLeft: 8.54 - case StackRight: 8.55 - c->w = md - 2 * BORDERPX; 8.56 - c->h = sh - bh - 2 * BORDERPX; 8.57 - break; 8.58 - case StackBottom: 8.59 - c->w = sw - 2 * BORDERPX; 8.60 - c->h = md - 2 * BORDERPX; 8.61 - break; 8.62 - } 8.63 + c->w = md - 2 * BORDERPX; 8.64 + c->h = sh - bh - 2 * BORDERPX; 8.65 } 8.66 else { /* tile window */ 8.67 - if(stackpos == StackRight) 8.68 - c->x += md; 8.69 + c->x += md; 8.70 if(th > bh) { 8.71 - switch(stackpos) { 8.72 - case StackLeft: 8.73 - case StackRight: 8.74 - c->y = sy + (i - 1) * th + bh; 8.75 - if(i + 1 == n) 8.76 - c->h = sh - c->y - 2 * BORDERPX; 8.77 - break; 8.78 - case StackBottom: 8.79 - c->y = sy + md + (i - 1) * th + bh; 8.80 - if(i + 1 == n) 8.81 - c->h = sh - c->y - 2 * BORDERPX; 8.82 - break; 8.83 - } 8.84 - c->w = tw - 2 * BORDERPX; 8.85 + c->y = sy + (i - 1) * th + bh; 8.86 + if(i + 1 == n) 8.87 + c->h = sh - c->y - 2 * BORDERPX; 8.88 + c->w = stackw - 2 * BORDERPX; 8.89 c->h = th - 2 * BORDERPX; 8.90 } 8.91 else { /* fallback if th < bh */ 8.92 - if(stackpos == StackBottom) 8.93 - c->y += md; 8.94 c->w = stackw - 2 * BORDERPX; 8.95 c->h = stackh - 2 * BORDERPX; 8.96 } 8.97 @@ -312,17 +278,6 @@ 8.98 } 8.99 8.100 void 8.101 -togglestackpos(Arg *arg) { 8.102 - if(arrange == dofloat) 8.103 - return; 8.104 - if(stackpos == StackBottom) 8.105 - stackpos = STACKPOS; 8.106 - else 8.107 - stackpos = StackBottom; 8.108 - arrange(NULL); 8.109 -} 8.110 - 8.111 -void 8.112 view(Arg *arg) { 8.113 unsigned int i; 8.114