-
Notifications
You must be signed in to change notification settings - Fork 1
/
dwm-no-border.diff
61 lines (57 loc) · 1.7 KB
/
dwm-no-border.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From c9065974a21579061b699e6eedc44239289b58de Mon Sep 17 00:00:00 2001
From: bakkeby <bakkeby@gmail.com>
Date: Tue, 22 Sep 2020 15:07:01 +0200
Subject: [PATCH] dwm_no_border_for_unselected_clients
---
dwm.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dwm.c b/dwm.c
index 664c527..1c6ddfc 100644
--- a/dwm.c
+++ b/dwm.c
@@ -803,6 +803,8 @@ focus(Client *c)
XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
}
selmon->sel = c;
+ if (selmon->sel)
+ resizeclient(c, c->x, c->y, c->w, c->h);
drawbars();
}
@@ -1282,7 +1284,13 @@ resizeclient(Client *c, int x, int y, int w, int h)
c->oldy = c->y; c->y = wc.y = y;
c->oldw = c->w; c->w = wc.width = w;
c->oldh = c->h; c->h = wc.height = h;
- wc.border_width = c->bw;
+ if (c == selmon->sel)
+ wc.border_width = c->bw;
+ else {
+ wc.border_width = 0;
+ wc.x += c->bw;
+ wc.y += c->bw;
+ }
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
configure(c);
XSync(dpy, False);
@@ -1618,7 +1626,10 @@ showhide(Client *c)
return;
if (ISVISIBLE(c)) {
/* show clients top down */
- XMoveWindow(dpy, c->win, c->x, c->y);
+ if (selmon->sel == c)
+ XMoveWindow(dpy, c->win, c->x, c->y);
+ else
+ XMoveWindow(dpy, c->win, c->x + borderpx, c->y + borderpx);
if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
resize(c, c->x, c->y, c->w, c->h, 0);
showhide(c->snext);
@@ -1760,6 +1771,9 @@ unfocus(Client *c, int setfocus)
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
}
+ if (c == selmon->sel)
+ selmon->sel = NULL;
+ resizeclient(c, c->x, c->y, c->w, c->h);
}
void
--
2.32.0