This repository has been archived by the owner on Jan 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
dwm-6.0-singularborders.diff
98 lines (94 loc) · 3.17 KB
/
dwm-6.0-singularborders.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
--- dwm.c.orig 2013-03-30 23:09:56.373392621 +0100
+++ dwm.c 2013-03-30 23:12:09.593390379 +0100
@@ -458,13 +458,16 @@ bstack(Monitor *m) {
for(i = mx = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
if(i < m->nmasters[m->curtag]) {
w = (m->ww - mx) / (MIN(n, m->nmasters[m->curtag]) - i);
- resize(c, m->wx + mx, m->wy, w - (2*c->bw), mh - (2*c->bw), False);
- mx += WIDTH(c);
+ if(n == 1)
+ resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False);
+ else
+ resize(c, m->wx + mx - c->bw, m->wy, w, mh - c->bw, False);
+ mx += WIDTH(c) - c->bw;
}
else {
w = (m->ww - tx) / (n - i);
- resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - (2*c->bw), False);
- tx += WIDTH(c);
+ resize(c, m->wx + tx - c->bw, m->wy + mh, w, m->wh - mh - c->bw, False);
+ tx += WIDTH(c) - c->bw;
}
}
@@ -527,7 +530,7 @@ chat(Monitor *m) {
/* buddy list */
ww = (bl ? m->mfacts[m->curtag] * m->ww : m->ww);
if(bl) {
- resize(bl, m->wx + ww, m->wy, m->ww - ww - 2 * bl->bw, m->wh - 2 * bl->bw, False);
+ resize(bl, m->wx - bl->bw + ww, m->wy, m->ww - ww, m->wh - bl->bw, False);
if(--n == 0)
return;
}
@@ -552,9 +555,12 @@ chat(Monitor *m) {
if(i/rows + 1 > cols - n%cols)
rows = n/cols + 1;
ch = rows ? m->wh / rows : m->wh;
- cx = m->wx + cn*cw;
+ cx = m->wx + cn*cw - c->bw;
cy = m->wy + rn*ch;
- resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False);
+ if(n == 1 && !bl)
+ resize(c, cx, cy, cw, ch, False);
+ else
+ resize(c, cx, cy, cw - c->bw, ch - c->bw, False);
rn++;
if(rn >= rows) {
rn = 0;
@@ -974,6 +980,8 @@ expose(XEvent *e) {
void
focus(Client *c) {
+ XWindowChanges wc;
+
if(!c || !ISVISIBLE(c))
for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
/* was if(selmon->sel) */
@@ -988,6 +996,11 @@ focus(Client *c) {
attachstack(c);
grabbuttons(c, True);
XSetWindowBorder(dpy, c->win, dc.sel[ColBorder].pixel);
+ if(!c->isfloating) {
+ wc.sibling = selmon->barwin;
+ wc.stack_mode = Below;
+ XConfigureWindow(dpy, c->win, CWSibling | CWStackMode, &wc);
+ }
setfocus(c);
}
else
@@ -1310,7 +1323,7 @@ monocle(Monitor *m) {
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);
+ resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False);
}
void
@@ -1896,13 +1909,16 @@ tile(Monitor *m) {
for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
if(i < m->nmasters[m->curtag]) {
h = (m->wh - my) / (MIN(n, m->nmasters[m->curtag]) - i);
- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
- my += HEIGHT(c);
+ if(n == 1)
+ resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False);
+ else
+ resize(c, m->wx - c->bw, m->wy + my, mw - c->bw, h - c->bw, False);
+ my += HEIGHT(c) - c->bw;
}
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);
- ty += HEIGHT(c);
+ resize(c, m->wx + mw - c->bw, m->wy + ty, m->ww - mw, h - c->bw, False);
+ ty += HEIGHT(c) - c->bw;
}
}