[wiki] [sites] add bstack patch for 6.0 that is nmaster aware || Carlos J. Torres

From: <hg_AT_suckless.org>
Date: Tue, 28 Feb 2012 17:38:13 +0100 (CET)

changeset: 869:63b2b21dd22a
tag: tip
user: Carlos J. Torres <vlaadbrain_AT_gmail.com>
date: Tue Feb 28 11:36:41 2012 -0500
files: dwm.suckless.org/patches/bottom_stack.md dwm.suckless.org/patches/dwm-6.0-bstack.diff
description:
add bstack patch for 6.0 that is nmaster aware


diff -r 930f385ae831 -r 63b2b21dd22a dwm.suckless.org/patches/bottom_stack.md
--- a/dwm.suckless.org/patches/bottom_stack.md Tue Feb 28 15:24:27 2012 +0100
+++ b/dwm.suckless.org/patches/bottom_stack.md Tue Feb 28 11:36:41 2012 -0500
_AT_@ -38,3 +38,6 @@
 * 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)
 
+6.0 (20120228) : is aware of nmaster
+* Not for use with pertag patch: [dwm-6.0-bstack.diff](dwm-6.0-bstack.diff)
+
diff -r 930f385ae831 -r 63b2b21dd22a dwm.suckless.org/patches/dwm-6.0-bstack.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/dwm-6.0-bstack.diff Tue Feb 28 11:36:41 2012 -0500
_AT_@ -0,0 +1,91 @@
+diff -r ec4baab78314 bstack.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/bstack.c Tue Feb 28 11:28:54 2012 -0500
+_AT_@ -0,0 +1,33 @@
++static void
++bstack(Monitor *m) {
++ int w, h, mh, mx, tx, ty, tw;
++ unsigned int i, n;
++ Client *c;
++
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++ if(n == 0)
++ return;
++ if(n > m->nmaster) {
++ mh = m->nmaster ? m->mfact * m->wh : 0;
++ tw = m->ww / (n - m->nmaster);
++ ty = m->wy + mh;
++ }
++ else {
++ mh = m->wh;
++ tw = m->ww;
++ ty = m->wy;
++ }
++ for(i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
++ if(i < m->nmaster) {
++ w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
++ resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), False);
++ mx += WIDTH(c);
++ }
++ else {
++ h = m->wh - mh;
++ resize(c, tx, ty, tw - (2 * c->bw), h - (2 * c->bw), False);
++ if(tw != m->ww)
++ tx += WIDTH(c);
++ }
++ }
++}
+diff -r ec4baab78314 bstackhoriz.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/bstackhoriz.c Tue Feb 28 11:28:54 2012 -0500
+_AT_@ -0,0 +1,31 @@
++static void
++bstackhoriz(Monitor *m) {
++ int w, mh, mx, tx, ty, th;
++ unsigned int i, n;
++ Client *c;
++
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++ if(n == 0)
++ return;
++ if(n > m->nmaster) {
++ mh = m->nmaster ? m->mfact * m->wh : 0;
++ th = (m->wh - mh) / (n - m->nmaster);
++ ty = m->wy + mh;
++ }
++ else {
++ th = mh = m->wh;
++ ty = m->wy;
++ }
++ for(i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
++ if(i < m->nmaster) {
++ w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
++ resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), False);
++ mx += WIDTH(c);
++ }
++ else {
++ resize(c, tx, ty, m->ww - (2 * c->bw), th - (2 * c->bw), False);
++ if(th != m->wh)
++ ty += HEIGHT(c);
++ }
++ }
++}
+diff -r ec4baab78314 config.def.h
+--- a/config.def.h Mon Dec 19 15:38:30 2011 +0100
++++ b/config.def.h Tue Feb 28 11:28:54 2012 -0500
+_AT_@ -27,11 +27,15 @@ static const float mfact = 0.55; /*
+ static const int nmaster = 1; /* number of clients in master area */
+ 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 */
Received on Tue Feb 28 2012 - 17:38:13 CET

This archive was generated by hypermail 2.3.0 : Thu Sep 13 2012 - 19:32:08 CEST