Created
February 12, 2012 07:45
-
-
Save mynameisbogdan/1807116 to your computer and use it in GitHub Desktop.
bstack dwm 6.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -2128,6 +2187,32 @@ zoom(const Arg *arg) { | |
pop(c); | |
} | |
+void | |
+bstack(Monitor *m) { | |
+ unsigned int i, n, w, mh, mx, tx; | |
+ 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->wh * m->mfact : 0; | |
+ else | |
+ mh = m->wh; | |
+ for(i = mx = tx = 0, 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 { | |
+ w = (m->ww - tx) / (n - i); | |
+ resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - (2*c->bw), False); | |
+ tx += WIDTH(c); | |
+ } | |
+} | |
+ | |
int | |
main(int argc, char *argv[]) { | |
if(argc == 2 && !strcmp("-v", argv[1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment