commit f08f1954c8b65fb0c2a44abbdcfd73065f679c03
Author: Andrew Milkovich <amilkovich_AT_gmail.com>
Date: Wed Nov 11 19:31:15 2015 -0800
update single window no border patch
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
index 31065cb..be7731a 100644
--- 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
_AT__AT_ -3,25 +3,23 @@ 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
-_AT_@ -1089,7 +1089,7 @@
-
+--- dwm/dwm.c.orig 2015-11-11 19:14:39.771079356 -0800
++++ dwm/dwm.c 2015-11-11 19:14:42.821079144 -0800
+_AT_@ -1117,7 +1117,7 @@ maprequest(XEvent *e)
void
- monocle(Monitor *m) {
+ monocle(Monitor *m)
+ {
- unsigned int n = 0;
+ unsigned int n = 0, r = 0;
Client *c;
- for(c = m->clients; c; c = c->next)
-_AT_@ -1097,8 +1097,17 @@
+ for (c = m->clients; c; c = c->next)
+_AT_@ -1125,8 +1125,17 @@ monocle(Monitor *m)
n++;
- if(n > 0) /* override layout symbol */
+ 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))
+- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
+ /* remove border when in monocle layout */
+ if(c->bw) {
_AT_@ -29,31 +27,31 @@ Index: dwm/dwm.c
+ c->bw = 0;
+ r = 1;
+ }
-+ resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False);
++ 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));
++ resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw));
+ }
}
void
-_AT_@ -1601,7 +1610,7 @@
-
+_AT_@ -1666,7 +1675,7 @@ tagmon(const Arg *arg)
void
- tile(Monitor *m) {
+ 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++);
-_AT_@ -1612,17 +1621,36 @@
+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+_AT_@ -1677,16 +1686,35 @@ tile(Monitor *m)
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) {
+- 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++) {
+ if(n == 1) {
+ if (c->bw) {
-+ /* remove border when only one window is on the current tag */
++ /* remove border when only one window is on the cu rrent tag */
+ c->oldbw = c->bw;
+ c->bw = 0;
+ r = 1;
_AT_@ -65,16 +63,15 @@ Index: dwm/dwm.c
+ c->oldbw = 0;
+ r = 1;
+ }
- if(i < m->nmaster) {
+ 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);
+ resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
+ if(r)
+ resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw));
my += HEIGHT(c);
- }
- else {
+ } 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);
+ resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
+ if(r)
+ resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw));
ty += HEIGHT(c);
_AT_@ -83,19 +80,19 @@ Index: dwm/dwm.c
}
void
-_AT_@ -1640,9 +1668,15 @@
- if(selmon->sel->isfullscreen) /* no support for fullscreen windows */
+_AT_@ -1706,9 +1734,15 @@ togglefloating(const Arg *arg)
+ 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) {
+- 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);
+ selmon->sel->w, selmon->sel->h, 0);
+ }
arrange(selmon);
}
diff --git a/dwm.suckless.org/patches/noborder.md b/dwm.suckless.org/patches/noborder.md
index 57359a5..359c32d 100644
--- a/dwm.suckless.org/patches/noborder.md
+++ b/dwm.suckless.org/patches/noborder.md
_AT_@ -13,7 +13,7 @@ Download
Patches against different versions of dwm are available at
[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) (20140209)
+ * [dwm-6.1-single_window_no_border.diff](dwm-6.1-single_window_no_border.diff) (3047b) (20151111)
* [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)
Received on Thu Nov 12 2015 - 04:30:53 CET