turgency hook handling needs also to invert the square if present - dwm - [fork… | |
git clone git://src.adamsgaard.dk/dwm | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit e8244395e4fb7f0617367187c799b1fbddeac7a2 | |
parent 954db46bac481fd3f514f7af50d2af7e73fb9115 | |
Author: Anselm R Garbe <[email protected]> | |
Date: Wed, 13 Feb 2008 20:34:17 +0000 | |
urgency hook handling needs also to invert the square if present | |
Diffstat: | |
M dwm.c | 17 ++++++++--------- | |
1 file changed, 8 insertions(+), 9 deletions(-) | |
--- | |
diff --git a/dwm.c b/dwm.c | |
t@@ -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… | |
void drawtext(Monitor *, const char *text, unsigned long col[ColLast], Bool in… | |
void *emallocz(unsigned int size); | |
void enternotify(XEvent *e); | |
t@@ -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->moni… | |
+ drawsquare(m, sel && sel->tags[j] && sel->moni… | |
+ isoccupied(m, j), isurgent(i, … | |
} | |
else { | |
drawtext(m, tags[j], m->dc.norm, isurgent(i, j… | |
- drawsquare(m, sel && sel->tags[j] && sel->moni… | |
+ drawsquare(m, sel && sel->tags[j] && sel->moni… | |
+ isoccupied(m, j), isurgent(i, … | |
} | |
m->dc.x += m->dc.w; | |
} | |
t@@ -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.se… | |
+ drawsquare(m, False, sel->isfloating, False, m… | |
} | |
else | |
drawtext(m, NULL, m->dc.norm, False); | |
t@@ -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… | |
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; | |
t@@ -1141,14 +1143,11 @@ monitorat() { | |
XQueryPointer(dpy, monitors[selmonitor].root, &win, &win, &x, &y, &i, … | |
for(i = 0; i < mcount; i++) { | |
- fprintf(stderr, "checking monitor[%d]: %d %d %d %d\n", i, moni… | |
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; | |
} | |