urgency hook handling needs also to invert the square if present
e8244395
1 file(s) · +8 −9
| 145 | 145 | void detach(Client *c); |
|
| 146 | 146 | void detachstack(Client *c); |
|
| 147 | 147 | void drawbar(void); |
|
| 148 | - | void drawsquare(Monitor *, Bool filled, Bool empty, unsigned long col[ColLast]); |
|
| 148 | + | void drawsquare(Monitor *, Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]); |
|
| 149 | 149 | void drawtext(Monitor *, const char *text, unsigned long col[ColLast], Bool invert); |
|
| 150 | 150 | void *emallocz(unsigned int size); |
|
| 151 | 151 | void enternotify(XEvent *e); |
|
| 570 | 570 | m->dc.w = textw(m, tags[j]); |
|
| 571 | 571 | if(m->seltags[j]) { |
|
| 572 | 572 | drawtext(m, tags[j], m->dc.sel, isurgent(i, j)); |
|
| 573 | - | drawsquare(m, sel && sel->tags[j] && sel->monitor == selmonitor, isoccupied(m, j), m->dc.sel); |
|
| 573 | + | drawsquare(m, sel && sel->tags[j] && sel->monitor == selmonitor, |
|
| 574 | + | isoccupied(m, j), isurgent(i, j), m->dc.sel); |
|
| 574 | 575 | } |
|
| 575 | 576 | else { |
|
| 576 | 577 | drawtext(m, tags[j], m->dc.norm, isurgent(i, j)); |
|
| 577 | - | drawsquare(m, sel && sel->tags[j] && sel->monitor == selmonitor, isoccupied(m, j), m->dc.norm); |
|
| 578 | + | drawsquare(m, sel && sel->tags[j] && sel->monitor == selmonitor, |
|
| 579 | + | isoccupied(m, j), isurgent(i, j), m->dc.norm); |
|
| 578 | 580 | } |
|
| 579 | 581 | m->dc.x += m->dc.w; |
|
| 580 | 582 | } |
|
| 592 | 594 | m->dc.x = x; |
|
| 593 | 595 | if(sel && sel->monitor == selmonitor) { |
|
| 594 | 596 | drawtext(m, sel->name, m->dc.sel, False); |
|
| 595 | - | drawsquare(m, False, sel->isfloating, m->dc.sel); |
|
| 597 | + | drawsquare(m, False, sel->isfloating, False, m->dc.sel); |
|
| 596 | 598 | } |
|
| 597 | 599 | else |
|
| 598 | 600 | drawtext(m, NULL, m->dc.norm, False); |
|
| 603 | 605 | } |
|
| 604 | 606 | ||
| 605 | 607 | void |
|
| 606 | - | drawsquare(Monitor *m, Bool filled, Bool empty, unsigned long col[ColLast]) { |
|
| 608 | + | drawsquare(Monitor *m, Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) { |
|
| 607 | 609 | int x; |
|
| 608 | 610 | XGCValues gcv; |
|
| 609 | 611 | XRectangle r = { m->dc.x, m->dc.y, m->dc.w, m->dc.h }; |
|
| 610 | 612 | ||
| 611 | - | gcv.foreground = col[ColFG]; |
|
| 613 | + | gcv.foreground = col[invert ? ColBG : ColFG]; |
|
| 612 | 614 | XChangeGC(dpy, m->dc.gc, GCForeground, &gcv); |
|
| 613 | 615 | x = (m->dc.font.ascent + m->dc.font.descent + 2) / 4; |
|
| 614 | 616 | r.x = m->dc.x + 1; |
|
| 1141 | 1143 | ||
| 1142 | 1144 | XQueryPointer(dpy, monitors[selmonitor].root, &win, &win, &x, &y, &i, &i, &mask); |
|
| 1143 | 1145 | for(i = 0; i < mcount; i++) { |
|
| 1144 | - | fprintf(stderr, "checking monitor[%d]: %d %d %d %d\n", i, monitors[i].sx, monitors[i].sy, monitors[i].sw, monitors[i].sh); |
|
| 1145 | 1146 | if((x >= monitors[i].sx && x < monitors[i].sx + monitors[i].sw) |
|
| 1146 | 1147 | && (y >= monitors[i].sy && y < monitors[i].sy + monitors[i].sh)) { |
|
| 1147 | - | fprintf(stderr, "%d,%d -> %d\n", x, y, i); |
|
| 1148 | 1148 | return i; |
|
| 1149 | 1149 | } |
|
| 1150 | 1150 | } |
|
| 1151 | - | fprintf(stderr, "?,? -> 0\n"); |
|
| 1152 | 1151 | return 0; |
|
| 1153 | 1152 | } |
|
| 1154 | 1153 | ||