-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdwm-5.8.2-trayer.patch
133 lines (127 loc) · 3.66 KB
/
dwm-5.8.2-trayer.patch
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
--- dwm.c.orig 2010-08-14 20:57:40.477896999 +0400
+++ dwm.c 2010-08-15 04:42:03.015519000 +0400
@@ -269,6 +269,7 @@
static Atom wmatom[WMLast], netatom[NetLast];
static Bool otherwm;
static Bool running = True;
+static Client *panel = NULL;
static Cursor cursor[CurLast];
static Display *dpy;
static DC dc;
@@ -313,7 +314,8 @@
if(ch.res_name)
XFree(ch.res_name);
}
- c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
+ if(!c->tags && panel != c)
+ c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
}
Bool
@@ -689,16 +691,18 @@
Client *c;
for(c = m->clients; c; c = c->next) {
- occ |= c->tags;
- if(c->isurgent)
- urg |= c->tags;
+ if(panel != c) {
+ occ |= c->tags;
+ if(c->isurgent)
+ urg |= c->tags;
+ }
}
dc.x = 0;
for(i = 0; i < LENGTH(tags); i++) {
dc.w = TEXTW(tags[i]);
col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
drawtext(tags[i], col, urg & 1 << i);
- drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+ drawsquare(m == selmon && (selmon->sel && selmon->sel != panel) && selmon->sel->tags & 1 << i,
occ & 1 << i, urg & 1 << i, col);
dc.x += dc.w;
}
@@ -817,8 +821,9 @@
void
focus(Client *c) {
+ if (panel == c) return;
if(!c || !ISVISIBLE(c))
- for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
+ for(c = selmon->stack; c && (!ISVISIBLE(c) || panel == c); c = c->snext);
/* was if(selmon->sel) */
if(selmon->sel && selmon->sel != c)
unfocus(selmon->sel, False);
@@ -867,17 +872,17 @@
if(!selmon->sel)
return;
if(arg->i > 0) {
- for(c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
+ for(c = selmon->sel->next; c && (!ISVISIBLE(c) || panel == c); c = c->next);
if(!c)
- for(c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
+ for(c = selmon->clients; c && (!ISVISIBLE(c) || panel == c); c = c->next);
}
else {
for(i = selmon->clients; i != selmon->sel; i = i->next)
- if(ISVISIBLE(i))
+ if(ISVISIBLE(i) && panel != i)
c = i;
if(!c)
for(; i; i = i->next)
- if(ISVISIBLE(i))
+ if(ISVISIBLE(i) && panel != i)
c = i;
}
if(c) {
@@ -954,7 +959,7 @@
unsigned int i, j;
unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
- if(focused) {
+ if(focused || panel == c) {
for(i = 0; i < LENGTH(buttons); i++)
if(buttons[i].click == ClkClientWin)
for(j = 0; j < LENGTH(modifiers); j++)
@@ -1137,6 +1142,13 @@
&& (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
c->bw = borderpx;
}
+
+ updatetitle(c);
+ if(strstr(c->name, "stalonetray") || strstr(c->name, "panel")) {
+ panel = c;
+ c->bw = 0;
+ }
+
wc.border_width = c->bw;
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
@@ -1201,6 +1213,7 @@
if(!(c = selmon->sel))
return;
+ if (panel == c) return;
restack(selmon);
ocx = c->x;
ocy = c->y;
@@ -1365,6 +1378,7 @@
if(!(c = selmon->sel))
return;
+ if (panel == c) return;
restack(selmon);
ocx = c->x;
ocy = c->y;
@@ -1575,7 +1589,7 @@
showhide(Client *c) {
if(!c)
return;
- if(ISVISIBLE(c)) { /* show clients top down */
+ if(ISVISIBLE(c) || panel == c) { /* show clients top down */
XMoveWindow(dpy, c->win, c->x, c->y);
if(!c->mon->lt[c->mon->sellt]->arrange || c->isfloating)
resize(c, c->x, c->y, c->w, c->h, False);
@@ -1720,6 +1734,8 @@
unmanage(Client *c, Bool destroyed) {
Monitor *m = c->mon;
XWindowChanges wc;
+
+ if(panel == c) panel = NULL;
/* The server grab construct avoids race conditions. */
detach(c);