about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-02-13 20:34:17 +0000
committerAnselm R Garbe <garbeam@gmail.com>2008-02-13 20:34:17 +0000
commite8244395e4fb7f0617367187c799b1fbddeac7a2 (patch)
treec187ff0b82a339551c0e92bb987da42de696c549
parent954db46bac481fd3f514f7af50d2af7e73fb9115 (diff)
downloaddwm-e8244395e4fb7f0617367187c799b1fbddeac7a2.tar.gz
urgency hook handling needs also to invert the square if present
-rw-r--r--dwm.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/dwm.c b/dwm.c
index 79a3a33..f992ea9 100644
--- a/dwm.c
+++ b/dwm.c
@@ -145,7 +145,7 @@ void destroynotify(XEvent *e);
 void detach(Client *c);
 void detachstack(Client *c);
 void drawbar(void);
-void drawsquare(Monitor *, Bool filled, Bool empty, unsigned long col[ColLast]);
+void drawsquare(Monitor *, Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
 void drawtext(Monitor *, const char *text, unsigned long col[ColLast], Bool invert);
 void *emallocz(unsigned int size);
 void enternotify(XEvent *e);
@@ -570,11 +570,13 @@ drawbar(void) {
 			m->dc.w = textw(m, tags[j]);
 			if(m->seltags[j]) {
 				drawtext(m, tags[j], m->dc.sel, isurgent(i, j));
-				drawsquare(m, sel && sel->tags[j] && sel->monitor == selmonitor, isoccupied(m, j), m->dc.sel);
+				drawsquare(m, sel && sel->tags[j] && sel->monitor == selmonitor,
+						isoccupied(m, j), isurgent(i, j), m->dc.sel);
 			}
 			else {
 				drawtext(m, tags[j], m->dc.norm, isurgent(i, j));
-				drawsquare(m, sel && sel->tags[j] && sel->monitor == selmonitor, isoccupied(m, j), m->dc.norm);
+				drawsquare(m, sel && sel->tags[j] && sel->monitor == selmonitor,
+						isoccupied(m, j), isurgent(i, j), m->dc.norm);
 			}
 			m->dc.x += m->dc.w;
 		}
@@ -592,7 +594,7 @@ drawbar(void) {
 			m->dc.x = x;
 			if(sel && sel->monitor == selmonitor) {
 				drawtext(m, sel->name, m->dc.sel, False);
-				drawsquare(m, False, sel->isfloating, m->dc.sel);
+				drawsquare(m, False, sel->isfloating, False, m->dc.sel);
 			}
 			else
 				drawtext(m, NULL, m->dc.norm, False);
@@ -603,12 +605,12 @@ drawbar(void) {
 }
 
 void
-drawsquare(Monitor *m, Bool filled, Bool empty, unsigned long col[ColLast]) {
+drawsquare(Monitor *m, Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
 	int x;
 	XGCValues gcv;
 	XRectangle r = { m->dc.x, m->dc.y, m->dc.w, m->dc.h };
 
-	gcv.foreground = col[ColFG];
+	gcv.foreground = col[invert ? ColBG : ColFG];
 	XChangeGC(dpy, m->dc.gc, GCForeground, &gcv);
 	x = (m->dc.font.ascent + m->dc.font.descent + 2) / 4;
 	r.x = m->dc.x + 1;
@@ -1141,14 +1143,11 @@ monitorat() {
 
 	XQueryPointer(dpy, monitors[selmonitor].root, &win, &win, &x, &y, &i, &i, &mask);
 	for(i = 0; i < mcount; i++) {
-		fprintf(stderr, "checking monitor[%d]: %d %d %d %d\n", i, monitors[i].sx, monitors[i].sy, monitors[i].sw, monitors[i].sh);
 		if((x >= monitors[i].sx && x < monitors[i].sx + monitors[i].sw)
 		&& (y >= monitors[i].sy && y < monitors[i].sy + monitors[i].sh)) {
-			fprintf(stderr, "%d,%d -> %d\n", x, y, i);
 			return i;
 		}
 	}
-	fprintf(stderr, "?,? -> 0\n");
 	return 0;
 }
 
wm/blame/draw.c?h=4.3&id=8a34fa50f75f4d6d8af234ac0c4f6d40b988d700'>^
8a34fa5 ^


39677ec ^
8a34fa5 ^




39677ec ^


8a34fa5 ^
39677ec ^
8a34fa5 ^


39677ec ^
8a34fa5 ^





39677ec ^
8a34fa5 ^






39677ec ^
8a34fa5 ^


39677ec ^


8a34fa5 ^
























8a8b795 ^
8a34fa5 ^










8a8b795 ^
8a34fa5 ^





















8a8b795 ^
8a34fa5 ^







39677ec ^
8a34fa5 ^
439e15d ^





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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170