sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 331345890e349daad556b1fa6a5a323ee1748133
parent 33d0574818216b8ea141d6b6c0131e6a872b2c6c
Author: Matt Boswell <mordervomubel+gitlab@lockmail.us>
Date:   Sat, 21 Nov 2015 16:33:03 -0500

update centeredmaster patch for 6.1

also fix indent/whitespace style in centeredmaster to match dwm.

Diffstat:
Mdwm.suckless.org/patches/centeredmaster.md | 12+-----------
Mdwm.suckless.org/patches/dwm-6.1-centeredmaster.diff | 49+++++++++++++++++++++++++------------------------
2 files changed, 26 insertions(+), 35 deletions(-)

diff --git a/dwm.suckless.org/patches/centeredmaster.md b/dwm.suckless.org/patches/centeredmaster.md @@ -48,17 +48,7 @@ With two clients in master: ## Links -* [dwm-6.1-centeredmaster.diff](dwm-6.1-centeredmaster.diff) - 4K, 2015/10/17 +* [dwm-6.1-centeredmaster.diff](dwm-6.1-centeredmaster.diff) - 2015/11/21 [jerome](http://blog.jardinmagique.info) <jerome@gcu.info> - - - - - - - - - - diff --git a/dwm.suckless.org/patches/dwm-6.1-centeredmaster.diff b/dwm.suckless.org/patches/dwm-6.1-centeredmaster.diff @@ -1,58 +1,59 @@ diff --git a/dwm.c b/dwm.c -index 783fcdb..ab179d8 100644 +index 0362114..fa5ae4c 100644 --- a/dwm.c +++ b/dwm.c -@@ -215,6 +215,7 @@ static void tag(const Arg *arg); +@@ -209,6 +209,7 @@ static void spawn(const Arg *arg); + static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tile(Monitor *); - static void htile(Monitor *); +static void centeredmaster(Monitor *); static void togglebar(const Arg *arg); static void togglefloating(const Arg *arg); static void toggletag(const Arg *arg); -@@ -1748,6 +1749,45 @@ htile(Monitor *m) { +@@ -1690,6 +1691,46 @@ tile(Monitor *m) } void -+centeredmaster(Monitor *m) { ++centeredmaster(Monitor *m) ++{ + unsigned int i, n, w, mh, mw, mx, mxo, my, myo, tx; + Client *c; + -+ // Count number of clients in the selected monitor ++ // Count number of clients in the selected monitor + for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + if(n == 0) + return; + -+ // initialize nmaster area ++ // initialize nmaster area + if(n > m->nmaster) { -+ // go mfact box in the center if more than nmaster clients ++ // go mfact box in the center if more than nmaster clients + mw = m->nmaster ? m->ww * m->mfact : 0; + mh = m->nmaster ? m->wh * m->mfact : 0; -+ mx = mxo = (m->ww - mw) / 2; -+ my = myo = (m->wh - mh) / 2; -+ } else { -+ // Go fullscreen if all clients are in the master area ++ mx = mxo = (m->ww - mw) / 2; ++ my = myo = (m->wh - mh) / 2; ++ } else { ++ // Go fullscreen if all clients are in the master area + mh = m->wh; -+ mw = m->ww; -+ mx = mxo = 0; -+ my = mxo = 0; -+ } ++ mw = m->ww; ++ mx = mxo = 0; ++ my = mxo = 0; ++ } + + for(i = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if(i < m->nmaster) { -+ // nmaster clients are stacked horizontally, in the center of the screen -+ w = (mw + mxo - mx) / (MIN(n, m->nmaster) - i); ++ // nmaster clients are stacked horizontally, in the center of the screen ++ w = (mw + mxo - mx) / (MIN(n, m->nmaster) - i); + resize(c, m->wx + mx, m->wy + my, w - (2*c->bw), mh - (2*c->bw), False); + mx += WIDTH(c); + } else { -+ // Stack clients are stacked horizontally -+ w = (m->ww - tx) / (n - i); -+ resize(c, m->wx + tx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False); ++ // Stack clients are stacked horizontally ++ w = (m->ww - tx) / (n - i); ++ resize(c, m->wx + tx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False); + tx += WIDTH(c); + } +} + +void - togglebar(const Arg *arg) { - selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; - updatebarpos(selmon); + togglebar(const Arg *arg) + { + selmon->showbar = !selmon->showbar;