sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 1152e4897561c9a86430bc06f962c79f21c8f253
parent 368beeeea619eade5fe33065a773fa67fd7f62e8
Author: Jerome Andrieux <jerome@gcu.info>
Date:   Fri,  7 Jan 2011 15:41:35 +0100

Updated patches and doc for uselessgap and bstack with 5.9
Diffstat:
Mdwm.suckless.org/patches/bottom_stack.md | 5+++++
Adwm.suckless.org/patches/dwm-5.9-bstack-alt.diff | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/dwm-5.9-bstack.diff | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/dwm-5.9-uselessgap.diff | 45+++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/uselessgap.md | 4++++
5 files changed, 239 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/bottom_stack.md b/dwm.suckless.org/patches/bottom_stack.md @@ -33,3 +33,8 @@ Download * Not for use with pertag patch: [dwm-5.8.2-bstack.diff](dwm-5.8.2-bstack.diff) * For use with pertag patch: [dwm-5.8.2-bstack-alt.diff](dwm-5.8.2-bstack-alt.diff) * see older versions in [historical patches](historical) + +5.9 (20110107) : +* Not for use with pertag patch: [dwm-5.9-bstack.diff](dwm-5.9-bstack.diff) +* For use with pertag patch: [dwm-5.9-bstack-alt.diff](dwm-5.9-bstack-alt.diff) + diff --git a/dwm.suckless.org/patches/dwm-5.9-bstack-alt.diff b/dwm.suckless.org/patches/dwm-5.9-bstack-alt.diff @@ -0,0 +1,98 @@ +diff -up dwm-5.8.2-original/config.def.h dwm-5.8.2/config.def.h +--- dwm-5.8.2-original/config.def.h 2010-06-04 06:39:15.000000000 -0400 ++++ dwm-5.8.2/config.def.h 2010-07-07 14:56:15.000000000 -0400 +@@ -31,6 +31,8 @@ static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, /* first entry is default */ + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, ++ { "TTT", bstack }, ++ { "===", bstackhoriz }, + }; + + /* key definitions */ + #define MODKEY Mod1Mask + #define TAGKEYS(KEY,TAG) \ + }; + +diff -up dwm-5.8.2-original/dwm.c dwm-5.8.2/dwm.c +--- dwm-5.8.2-original/dwm.c 2010-06-04 06:39:15.000000000 -0400 ++++ dwm-5.8.2/dwm.c 2010-07-07 15:03:16.000000000 -0400 +@@ -158,6 +158,8 @@ static void arrange(Monitor *m); + static void arrangemon(Monitor *m); + static void attach(Client *c); + static void attachstack(Client *c); ++static void bstack(Monitor *m); ++static void bstackhoriz(Monitor *m); + static void buttonpress(XEvent *e); + static void checkotherwm(void); + static void cleanup(void); +@@ -1657,6 +1659,67 @@ tile(Monitor *m) { + if(h < bh) + h = m->wh; + for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { ++ resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) ++ ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False); ++ if(h != m->wh) ++ y = c->y + HEIGHT(c); ++ } ++} ++ ++static void ++bstack(Monitor *m) { ++ int x, y, h, w, mh; ++ unsigned int i, n; ++ Client *c; ++ ++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); ++ if(n == 0) ++ return; ++ /* master */ ++ c = nexttiled(m->clients); ++ mh = m->mfact * m->wh; ++ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False); ++ if(--n == 0) ++ return; ++ /* tile stack */ ++ x = m->wx; ++ y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh; ++ w = m->ww / n; ++ h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh; ++ if(w < bh) ++ w = m->ww; ++ for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { ++ resize(c, x, y, /* remainder */ ((i + 1 == n) ++ ? m->wx + m->ww - x - 2 * c->bw : w - 2 * c->bw), h - 2 * c->bw, False); ++ if(w != m->ww) ++ x = c->x + WIDTH(c); ++ } ++} ++ ++static void ++bstackhoriz(Monitor *m) { ++ int x, y, h, w, mh; ++ unsigned int i, n; ++ Client *c; ++ ++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); ++ if(n == 0) ++ return; ++ /* master */ ++ c = nexttiled(m->clients); ++ mh = m->mfact * m->wh; ++ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False); ++ if(--n == 0) ++ return; ++ /* tile stack */ ++ x = m->wx; ++ y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh; ++ w = m->ww; ++ h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh; ++ h /= n; ++ if(h < bh) ++ h = m->wh; ++ for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { + resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) + ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False); + if(h != m->wh) + diff --git a/dwm.suckless.org/patches/dwm-5.9-bstack.diff b/dwm.suckless.org/patches/dwm-5.9-bstack.diff @@ -0,0 +1,87 @@ +diff -NU5 -r dwm-5.8.2/bstack.c dwm-5.8.2-bstack/bstack.c +--- dwm-5.8.2/bstack.c 1970-01-01 01:00:00.000000000 +0100 ++++ dwm-5.8.2-bstack/bstack.c 2010-06-15 17:47:44.000000000 +0200 +@@ -0,0 +1,29 @@ ++static void ++bstack(Monitor *m) { ++ int x, y, h, w, mh; ++ unsigned int i, n; ++ Client *c; ++ ++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); ++ if(n == 0) ++ return; ++ /* master */ ++ c = nexttiled(m->clients); ++ mh = m->mfact * m->wh; ++ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False); ++ if(--n == 0) ++ return; ++ /* tile stack */ ++ x = m->wx; ++ y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh; ++ w = m->ww / n; ++ h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh; ++ if(w < bh) ++ w = m->ww; ++ for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { ++ resize(c, x, y, /* remainder */ ((i + 1 == n) ++ ? m->wx + m->ww - x - 2 * c->bw : w - 2 * c->bw), h - 2 * c->bw, False); ++ if(w != m->ww) ++ x = c->x + WIDTH(c); ++ } ++} +diff -NU5 -r dwm-5.8.2/bstackhoriz.c dwm-5.8.2-bstack/bstackhoriz.c +--- dwm-5.8.2/bstackhoriz.c 1970-01-01 01:00:00.000000000 +0100 ++++ dwm-5.8.2-bstack/bstackhoriz.c 2010-06-15 17:47:44.000000000 +0200 +@@ -0,0 +1,30 @@ ++static void ++bstackhoriz(Monitor *m) { ++ int x, y, h, w, mh; ++ unsigned int i, n; ++ Client *c; ++ ++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); ++ if(n == 0) ++ return; ++ /* master */ ++ c = nexttiled(m->clients); ++ mh = m->mfact * m->wh; ++ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False); ++ if(--n == 0) ++ return; ++ /* tile stack */ ++ x = m->wx; ++ y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh; ++ w = m->ww; ++ h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh; ++ h /= n; ++ if(h < bh) ++ h = m->wh; ++ for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { ++ resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) ++ ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False); ++ if(h != m->wh) ++ y = c->y + HEIGHT(c); ++ } ++} + +diff -r 23b71491e149 config.def.h +--- a/config.def.h Thu Dec 02 10:16:47 2010 +0000 ++++ b/config.def.h Fri Jan 07 15:10:06 2011 +0100 +@@ -26,11 +26,15 @@ + static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ + static const Bool resizehints = True; /* True means respect size hints in tiled resizals */ + ++#include "bstack.c" ++#include "bstackhoriz.c" + static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, /* first entry is default */ + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, ++ { "TTT", bstack }, ++ { "===", bstackhoriz }, + }; + + /* key definitions */ diff --git a/dwm.suckless.org/patches/dwm-5.9-uselessgap.diff b/dwm.suckless.org/patches/dwm-5.9-uselessgap.diff @@ -0,0 +1,45 @@ +diff -r 23b71491e149 config.def.h +--- a/config.def.h Thu Dec 02 10:16:47 2010 +0000 ++++ b/config.def.h Fri Jan 07 08:50:42 2011 +0100 +@@ -9,6 +9,7 @@ + static const char selbgcolor[] = "#0066ff"; + static const char selfgcolor[] = "#ffffff"; + static const unsigned int borderpx = 1; /* border pixel of windows */ ++static const unsigned int gappx = 6; /* gap pixel between windows */ + static const unsigned int snap = 32; /* snap pixel */ + static const Bool showbar = True; /* False means no bar */ + static const Bool topbar = True; /* False means bottom bar */ +diff -r 23b71491e149 dwm.c +--- a/dwm.c Thu Dec 02 10:16:47 2010 +0000 ++++ b/dwm.c Fri Jan 07 08:50:42 2011 +0100 +@@ -273,6 +273,8 @@ + static DC dc; + static Monitor *mons = NULL, *selmon = NULL; + static Window root; ++static int globalborder ; ++static int globalborder ; + + /* configuration, allows nested code to access above variables */ + #include "config.h" +@@ -1329,11 +1331,17 @@ + void + resizeclient(Client *c, int x, int y, int w, int h) { + XWindowChanges wc; ++ ++ if(c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) { globalborder = 0 ; } ++ else { ++ if (selmon->lt[selmon->sellt]->arrange == monocle) { globalborder = 0 - borderpx ; } ++ else { globalborder = gappx ; } ++ } + +- c->oldx = c->x; c->x = wc.x = x; +- c->oldy = c->y; c->y = wc.y = y; +- c->oldw = c->w; c->w = wc.width = w; +- c->oldh = c->h; c->h = wc.height = h; ++ c->oldx = c->x; c->x = wc.x = x + globalborder ; ++ c->oldy = c->y; c->y = wc.y = y + globalborder ; ++ c->oldw = c->w; c->w = wc.width = w - 2 * globalborder ; ++ c->oldh = c->h; c->h = wc.height = h - 2 * globalborder ; + wc.border_width = c->bw; + XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); + configure(c); diff --git a/dwm.suckless.org/patches/uselessgap.md b/dwm.suckless.org/patches/uselessgap.md @@ -33,6 +33,10 @@ The size of the gap is configured in config.def.h. ## Download + * [dwm-5.9-uselessgap.diff](dwm-5.9-uselessgap.dif) (0.7K) (20110107 updated. Thanks Jordan for your bug report) + + Update to use the new resizeclient() function instead of resize() + * [dwm-uselessgap-5.8.diff](dwm-uselessgap-5.8.diff) (0.7K) (20100225 updated. Thanks Guillaume for your bug report) Fix floating clients bug and remove all borders in monocle mode.