sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 63ca06da65af0063b7c9e49a191e07d5de9f8ac8
parent 9f3bc41514082bb9ed6846cdf43a69f491f9c566
Author: Eric Pruitt <eric.pruitt@gmail.com>
Date:   Sun, 13 Jul 2014 19:15:45 -0500

Added better-borders patch

- Better-borders patch hides borders when only one window is shown and
  ensures monitor-sized windows are borderless.

Diffstat:
Adwm.suckless.org/patches/better-borders.md | 22++++++++++++++++++++++
Adwm.suckless.org/patches/dwm-6.1-better-borders.diff | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/noborder.md | 3+++
3 files changed, 117 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/better-borders.md b/dwm.suckless.org/patches/better-borders.md @@ -0,0 +1,22 @@ +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 +not depend on layout-specific changes and should automatically work with most +layouts. The patch also removes borders from any windows that are the same size +as the monitor and marks them full-screen even if their X properties indicate +otherwise. This eliminates nuisance borders that appear with some games and +applications while in full-screen mode. + +Download +-------- + + * [dwm-6.1-better-borders.diff](dwm-6.1-better-borders.diff) (2014-07-13) + +Author +------ + * Eric Pruitt - `<eric dot pruitt at gmail dot com>` diff --git a/dwm.suckless.org/patches/dwm-6.1-better-borders.diff b/dwm.suckless.org/patches/dwm-6.1-better-borders.diff @@ -0,0 +1,92 @@ +Author: Eric Pruitt, https://github.com/ericpruitt/ +Description: This patch makes dwm remove borders when only one, non-floating +window is visible. Additionally, any windows that are the same size as the +monitor are considered full-screen and their borders removed accordingly. + +diff --git a/dwm.c b/dwm.c +index ffc8864..3ce8ebe 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -308,6 +308,34 @@ applyrules(Client *c) { + c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; + } + ++void ++adjustborders(Monitor *m) { ++ Client *c, *l = NULL; ++ int visible = 0; ++ ++ for(c = m->clients; c; c = c->next) { ++ if (ISVISIBLE(c) && !c->isfloating && m->lt[m->sellt]->arrange) { ++ if (m->lt[m->sellt]->arrange == monocle) { ++ visible = 1; ++ c->oldbw = c->bw; ++ c->bw = 0; ++ } else { ++ visible++; ++ c->oldbw = c->bw; ++ c->bw = borderpx; ++ } ++ ++ l = c; ++ } ++ } ++ ++ if (l && visible == 1 && l->bw) { ++ l->oldbw = l->bw; ++ l->bw = 0; ++ resizeclient(l, l->x, l->y, l->w, l->h); ++ } ++} ++ + Bool + applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact) { + Bool baseismin; +@@ -376,10 +404,13 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact) { + + void + arrange(Monitor *m) { +- if(m) ++ if(m) { ++ adjustborders(m); + showhide(m->stack); +- else for(m = mons; m; m = m->next) ++ } else for(m = mons; m; m = m->next) { ++ adjustborders(m); + showhide(m->stack); ++ } + if(m) { + arrangemon(m); + restack(m); +@@ -1036,7 +1067,20 @@ manage(Window w, XWindowAttributes *wa) { + /* only fix client y-offset, if the client center might cover the bar */ + c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx) + && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my); +- c->bw = borderpx; ++ ++ updatewindowtype(c); ++ if (c->isfloating) { ++ c->bw = c->isfullscreen ? 0 : borderpx; ++ } else { ++ c->bw = 0; ++ for(t = c->mon->clients; t; t = c->next) { ++ if (!t->isfloating && c != t && c->tags & t->tags) { ++ c->bw = borderpx; ++ break; ++ } ++ } ++ adjustborders(c->mon); ++ } + + wc.border_width = c->bw; + XConfigureWindow(dpy, w, CWBorderWidth, &wc); +@@ -1933,7 +1977,8 @@ updatewindowtype(Client *c) { + Atom state = getatomprop(c, netatom[NetWMState]); + Atom wtype = getatomprop(c, netatom[NetWMWindowType]); + +- if(state == netatom[NetWMFullscreen]) ++ if(state == netatom[NetWMFullscreen] || ++ (WIDTH(c) == (c->mon->mx + c->mon->mw) && (HEIGHT(c) == (c->mon->my + c->mon->mh)))) + setfullscreen(c, True); + if(wtype == netatom[NetWMWindowTypeDialog]) + c->isfloating = True; diff --git a/dwm.suckless.org/patches/noborder.md b/dwm.suckless.org/patches/noborder.md @@ -5,6 +5,9 @@ Description ----------- This patch removes the border when there is just one window visible in tiled or monocle layout. +For an alternative that works with most layouts without any layout-specific +changes, check out [better borders](http://dwm.suckless.org/patches/better-borders). + Download -------- Patches against different versions of dwm are available at