commit deb1a29f19d058bf443f44a2b3d38cb772b892a0
parent 6b795aac38dd2793e9139a332861a3aa04e36887
Author: Jan Christoph Ebersbach <jceb@e-jc.de>
Date: Sun, 9 Feb 2014 20:09:42 +0100
update noborder patch
Diffstat:
2 files changed, 104 insertions(+), 1 deletion(-)
diff --git a/dwm.suckless.org/patches/dwm-6.1-single_window_no_border.diff b/dwm.suckless.org/patches/dwm-6.1-single_window_no_border.diff
@@ -0,0 +1,102 @@
+Author: Jan Christoph Ebersbach <jceb@e-jc.de>
+URL: http://dwm.suckless.org/patches/noborder
+This patch removes the border when there is just one window visible in tiled or
+monocle layout.
+
+Index: dwm/dwm.c
+===================================================================
+--- dwm/dwm.c.orig 2014-02-09 15:24:19.404117168 +0100
++++ dwm/dwm.c 2014-02-09 15:24:19.396117168 +0100
+@@ -1089,7 +1089,7 @@
+
+ void
+ monocle(Monitor *m) {
+- unsigned int n = 0;
++ unsigned int n = 0, r = 0;
+ Client *c;
+
+ for(c = m->clients; c; c = c->next)
+@@ -1097,8 +1097,17 @@
+ n++;
+ if(n > 0) /* override layout symbol */
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
+- for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
+- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
++ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
++ /* remove border when in monocle layout */
++ if(c->bw) {
++ c->oldbw = c->bw;
++ c->bw = 0;
++ r = 1;
++ }
++ resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False);
++ if(r)
++ resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw));
++ }
+ }
+
+ void
+@@ -1601,7 +1610,7 @@
+
+ void
+ tile(Monitor *m) {
+- unsigned int i, n, h, mw, my, ty;
++ unsigned int i, n, h, mw, my, ty, r;
+ Client *c;
+
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+@@ -1612,17 +1621,36 @@
+ mw = m->nmaster ? m->ww * m->mfact : 0;
+ else
+ mw = m->ww;
+- for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
++ for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) {
++ if(n == 1) {
++ if (c->bw) {
++ /* remove border when only one window is on the current tag */
++ c->oldbw = c->bw;
++ c->bw = 0;
++ r = 1;
++ }
++ }
++ else if(!c->bw && c->oldbw) {
++ /* restore border when more than one window is displayed */
++ c->bw = c->oldbw;
++ c->oldbw = 0;
++ r = 1;
++ }
+ if(i < m->nmaster) {
+ h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+ resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
++ if(r)
++ resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw));
+ my += HEIGHT(c);
+ }
+ else {
+ h = (m->wh - ty) / (n - i);
+ resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
++ if(r)
++ resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw));
+ ty += HEIGHT(c);
+ }
++ }
+ }
+
+ void
+@@ -1640,9 +1668,15 @@
+ if(selmon->sel->isfullscreen) /* no support for fullscreen windows */
+ return;
+ selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
+- if(selmon->sel->isfloating)
++ if(selmon->sel->isfloating) {
++ /* restore border when moving window into floating mode */
++ if(!selmon->sel->bw && selmon->sel->oldbw) {
++ selmon->sel->bw = selmon->sel->oldbw;
++ selmon->sel->oldbw = 0;
++ }
+ resize(selmon->sel, selmon->sel->x, selmon->sel->y,
+ selmon->sel->w, selmon->sel->h, False);
++ }
+ arrange(selmon);
+ }
+
diff --git a/dwm.suckless.org/patches/noborder.md b/dwm.suckless.org/patches/noborder.md
@@ -8,8 +8,9 @@ This patch removes the border when there is just one window visible in tiled or
Download
--------
Patches against different versions of dwm are available at
-[dwm-clean-patches](https://bitbucket.org/jceb81/dwm-clean-patches/src).
+[dwm-clean-patches](https://github.com/jceb/dwm-clean-patches).
+ * [dwm-6.1-single_window_no_border.diff](dwm-6.1-single_window_no_border.diff) (3025b) (20120406)
* [dwm-10e232f9ace7-statusallmons.diff](dwm-10e232f9ace7-statusallmons.diff) (982b) (20120406)
* [dwm-6.0-single_window_no_border.diff](dwm-6.0-single_window_no_border.diff) (2865b) (20120406)