dwm-unfocusednoborders-6.5.diff - sites - public wiki contents of suckless.org
(HTM) git clone git://git.suckless.org/sites
(DIR) Log
(DIR) Files
(DIR) Refs
---
dwm-unfocusednoborders-6.5.diff (1179B)
---
1 From 6800ba5aa83502012f6a51a00534edacaee7820f Mon Sep 17 00:00:00 2001
2 From: Jakub Skowron <jakubskowron676@gmail.com>
3 Date: Tue, 24 Jun 2025 14:46:46 +0200
4 Subject: [PATCH] remove borders on unfocused windows
5
6 This patch completely removes borders on all windows that are not
7 focused and adds them back in once they are (e.g. once hovered over).
8 ---
9 dwm.c | 9 ++++++++-
10 1 file changed, 8 insertions(+), 1 deletion(-)
11
12 diff --git a/dwm.c b/dwm.c
13 index 1443802..7b2bc88 100644
14 --- a/dwm.c
15 +++ b/dwm.c
16 @@ -800,7 +800,11 @@ focus(Client *c)
17 detachstack(c);
18 attachstack(c);
19 grabbuttons(c, 1);
20 +
21 + c->bw = borderpx;
22 XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
23 + arrange(c->mon);
24 +
25 setfocus(c);
26 } else {
27 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
28 @@ -1767,7 +1771,10 @@ unfocus(Client *c, int setfocus)
29 if (!c)
30 return;
31 grabbuttons(c, 0);
32 - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
33 +
34 + c->bw = 0;
35 + arrange(c->mon);
36 +
37 if (setfocus) {
38 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
39 XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
40 --
41 2.50.0
42