sites

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

commit fbc80c054e20ba2b068a333d4c224526fbb884b1
parent 8aa8a6d0d4d0330e35bf2683f4464f19d4c7cde7
Author: FRIGN <dev@frign.de>
Date:   Mon, 18 Jul 2016 07:43:13 +0200

dwm better borders patch: rename to "noborder" and fix patches

Diffstat:
Ddwm.suckless.org/patches/better-borders.md | 22----------------------
Ddwm.suckless.org/patches/dwm-better-borders-git-20160702-56a31dc.diff | 75---------------------------------------------------------------------------
Adwm.suckless.org/patches/dwm-noborder-20160718-56a31dc.diff | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/dwm-noborder-6.1.diff | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/noborder.md | 19+++++++++++++++++++
5 files changed, 161 insertions(+), 97 deletions(-)

diff --git a/dwm.suckless.org/patches/better-borders.md b/dwm.suckless.org/patches/better-borders.md @@ -1,22 +0,0 @@ -better borders -============== - -Description ------------ - -Like [Ebersbach's patch](http://dwm.suckless.org/patches/noborder), this patch -removes the border when there is only one window visible, but this patch does -should automatically work with most other custom layouts with no additiona -layout-specific changes. - -Thanks to Alesandar Metodiev for reporting a bug that lead to the patch being -rewritten. - -Download --------- - - * [dwm-better-borders-git-20160702-56a31dc.diff](dwm-better-borders-git-20160702-56a31dc.diff) - -Author ------- - * Eric Pruitt - `<eric dot pruitt at gmail dot com>` diff --git a/dwm.suckless.org/patches/dwm-better-borders-git-20160702-56a31dc.diff b/dwm.suckless.org/patches/dwm-better-borders-git-20160702-56a31dc.diff @@ -1,75 +0,0 @@ -Author: Eric Pruitt, https://github.com/ericpruitt/ -Description: This patch disables borders on tiled windows when only one, -non-floating window is visible. - -diff --git a/dwm.c b/dwm.c -index b2bc9bd..d3e1970 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -395,9 +395,24 @@ arrange(Monitor *m) - void - arrangemon(Monitor *m) - { -+ int n = 0; -+ Client *c; - strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); -- if (m->lt[m->sellt]->arrange) -- m->lt[m->sellt]->arrange(m); -+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if ((m->lt[m->sellt]->arrange != monocle && n > 1) || !m->lt[m->sellt]->arrange) { -+ for (c = m->clients; c; c = c->next) { -+ if (ISVISIBLE(c) && (!m->lt[m->sellt]->arrange || !c->isfloating) && (c->bw != borderpx)) { -+ c->oldbw = c->bw; -+ c->bw = borderpx; -+ resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); -+ } -+ } -+ if (m->lt[m->sellt]->arrange) { -+ m->lt[m->sellt]->arrange(m); -+ } -+ } else { -+ monocle(m); -+ } - } - - void -@@ -1126,10 +1141,19 @@ monocle(Monitor *m) - for (c = m->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; -- if (n > 0) /* override layout symbol */ -+ if (n > 0 && m->lt[m->sellt]->arrange == monocle) /* 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, 0); -+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { -+ // I'm not sure, but calling resize with the border width subtractions -+ // fixes a glitch where windows would not redraw until they were -+ // manually resized after restarting dwm. -+ resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); -+ if (c->bw) { -+ c->oldbw = c->bw; -+ c->bw = 0; -+ resizeclient(c, m->wx, m->wy, m->ww, m->wh); -+ } -+ } - } - - void -@@ -1705,9 +1729,14 @@ 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->bw != borderpx) { -+ selmon->sel->oldbw = selmon->sel->bw; -+ selmon->sel->bw = borderpx; -+ } - resize(selmon->sel, selmon->sel->x, selmon->sel->y, -- selmon->sel->w, selmon->sel->h, 0); -+ selmon->sel->w - selmon->sel->bw * 2, selmon->sel->h - selmon->sel->bw * 2, 0); -+ } - arrange(selmon); - } - diff --git a/dwm.suckless.org/patches/dwm-noborder-20160718-56a31dc.diff b/dwm.suckless.org/patches/dwm-noborder-20160718-56a31dc.diff @@ -0,0 +1,71 @@ +diff --git a/dwm.c b/dwm.c +index b2bc9bd..d3e1970 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -395,9 +395,24 @@ arrange(Monitor *m) + void + arrangemon(Monitor *m) + { ++ int n = 0; ++ Client *c; + strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); +- if (m->lt[m->sellt]->arrange) +- m->lt[m->sellt]->arrange(m); ++ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); ++ if ((m->lt[m->sellt]->arrange != monocle && n > 1) || !m->lt[m->sellt]->arrange) { ++ for (c = m->clients; c; c = c->next) { ++ if (ISVISIBLE(c) && (!m->lt[m->sellt]->arrange || !c->isfloating) && (c->bw != borderpx)) { ++ c->oldbw = c->bw; ++ c->bw = borderpx; ++ resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); ++ } ++ } ++ if (m->lt[m->sellt]->arrange) { ++ m->lt[m->sellt]->arrange(m); ++ } ++ } else { ++ monocle(m); ++ } + } + + void +@@ -1126,10 +1141,19 @@ monocle(Monitor *m) + for (c = m->clients; c; c = c->next) + if (ISVISIBLE(c)) + n++; +- if (n > 0) /* override layout symbol */ ++ if (n > 0 && m->lt[m->sellt]->arrange == monocle) /* 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, 0); ++ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { ++ // I'm not sure, but calling resize with the border width subtractions ++ // fixes a glitch where windows would not redraw until they were ++ // manually resized after restarting dwm. ++ resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); ++ if (c->bw) { ++ c->oldbw = c->bw; ++ c->bw = 0; ++ resizeclient(c, m->wx, m->wy, m->ww, m->wh); ++ } ++ } + } + + void +@@ -1705,9 +1729,14 @@ 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->bw != borderpx) { ++ selmon->sel->oldbw = selmon->sel->bw; ++ selmon->sel->bw = borderpx; ++ } + resize(selmon->sel, selmon->sel->x, selmon->sel->y, +- selmon->sel->w, selmon->sel->h, 0); ++ selmon->sel->w - selmon->sel->bw * 2, selmon->sel->h - selmon->sel->bw * 2, 0); ++ } + arrange(selmon); + } + diff --git a/dwm.suckless.org/patches/dwm-noborder-6.1.diff b/dwm.suckless.org/patches/dwm-noborder-6.1.diff @@ -0,0 +1,71 @@ +diff --git a/dwm.c b/dwm.c +index 0362114..e3209e5 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -393,9 +393,24 @@ arrange(Monitor *m) + void + arrangemon(Monitor *m) + { ++ int n = 0; ++ Client *c; + strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); +- if (m->lt[m->sellt]->arrange) +- m->lt[m->sellt]->arrange(m); ++ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); ++ if ((m->lt[m->sellt]->arrange != monocle && n > 1) || !m->lt[m->sellt]->arrange) { ++ for (c = m->clients; c; c = c->next) { ++ if (ISVISIBLE(c) && (!m->lt[m->sellt]->arrange || !c->isfloating) && (c->bw != borderpx)) { ++ c->oldbw = c->bw; ++ c->bw = borderpx; ++ resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); ++ } ++ } ++ if (m->lt[m->sellt]->arrange) { ++ m->lt[m->sellt]->arrange(m); ++ } ++ } else { ++ monocle(m); ++ } + } + + void +@@ -1123,10 +1138,19 @@ monocle(Monitor *m) + for (c = m->clients; c; c = c->next) + if (ISVISIBLE(c)) + n++; +- if (n > 0) /* override layout symbol */ ++ if (n > 0 && m->lt[m->sellt]->arrange == monocle) /* 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, 0); ++ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { ++ // I'm not sure, but calling resize with the border width subtractions ++ // fixes a glitch where windows would not redraw until they were ++ // manually resized after restarting dwm. ++ resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); ++ if (c->bw) { ++ c->oldbw = c->bw; ++ c->bw = 0; ++ resizeclient(c, m->wx, m->wy, m->ww, m->wh); ++ } ++ } + } + + void +@@ -1706,9 +1730,14 @@ 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->bw != borderpx) { ++ selmon->sel->oldbw = selmon->sel->bw; ++ selmon->sel->bw = borderpx; ++ } + resize(selmon->sel, selmon->sel->x, selmon->sel->y, +- selmon->sel->w, selmon->sel->h, 0); ++ selmon->sel->w - selmon->sel->bw * 2, selmon->sel->h - selmon->sel->bw * 2, 0); ++ } + arrange(selmon); + } + diff --git a/dwm.suckless.org/patches/noborder.md b/dwm.suckless.org/patches/noborder.md @@ -0,0 +1,19 @@ +noborder +======== + +Description +----------- + +Remove the border when there is only one window visible. + +Download +-------- + + * [dwm-noborder-6.1.diff](dwm-noborder-6.1.diff) + * [dwm-noborder-20160718-56a31dc.diff](dwm-noborder-20160718-56a31dc.diff) + +Authors +------- + + * Eric Pruitt - <eric.pruitt@gmail.com> + * Laslo Hunhold - <dev@frign.de> (6.1, git port)