From 646b351cc79845f4cc77415dfff474b9ae0053d9 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 20 Oct 2015 23:34:49 +0200 Subject: sync updated drw code from dmenu important: - drw_rect: didn't use w and h, change the dwm code accordingly. - drw_text: text is NULL is not allowed, use drw_rect(). --- dwm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index 6295831b..96b43f7e 100644 --- a/dwm.c +++ b/dwm.c @@ -689,10 +689,12 @@ dirtomon(int dir) { void drawbar(Monitor *m) { - int x, xx, w; + int x, xx, w, dx; unsigned int i, occ = 0, urg = 0; Client *c; + dx = (drw->fonts[0]->ascent + drw->fonts[0]->descent + 2) / 4; + for(c = m->clients; c; c = c->next) { occ |= c->tags; if(c->isurgent) @@ -703,7 +705,7 @@ drawbar(Monitor *m) { w = TEXTW(tags[i]); drw_setscheme(drw, m->tagset[m->seltags] & 1 << i ? &scheme[SchemeSel] : &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, tags[i], urg & 1 << i); - drw_rect(drw, x, 0, w, bh, m == selmon && selmon->sel && selmon->sel->tags & 1 << i, + drw_rect(drw, x + 1, 1, dx, dx, m == selmon && selmon->sel && selmon->sel->tags & 1 << i, occ & 1 << i, urg & 1 << i); x += w; } @@ -728,11 +730,11 @@ drawbar(Monitor *m) { if(m->sel) { drw_setscheme(drw, m == selmon ? &scheme[SchemeSel] : &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, m->sel->name, 0); - drw_rect(drw, x, 0, w, bh, m->sel->isfixed, m->sel->isfloating, 0); + drw_rect(drw, x + 1, 1, dx, dx, m->sel->isfixed, m->sel->isfloating, 0); } else { drw_setscheme(drw, &scheme[SchemeNorm]); - drw_text(drw, x, 0, w, bh, NULL, 0); + drw_rect(drw, x, 0, w, bh, 1, 0, 1); } } drw_map(drw, m->barwin, 0, 0, m->ww, bh); -- cgit v1.2.3