X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=draw.c;h=58f3998198308d5699987633515cf87b43d93f61;hb=587100873a66e34251041678504a8c1e28410591;hp=25b08c6b7bf75999f88673daa30e055631a996d2;hpb=e7508783e85aba0ce4ab09b0dd76c40342113aed;p=dwm.git diff --git a/draw.c b/draw.c index 25b08c6..58f3998 100644 --- a/draw.c +++ b/draw.c @@ -6,17 +6,6 @@ /* static */ -static unsigned int -textnw(const char *text, unsigned int len) { - XRectangle r; - - if(dc.font.set) { - XmbTextExtents(dc.font.set, text, len, NULL, &r); - return r.width; - } - return XTextWidth(dc.font.xfont, text, len); -} - static void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) { int x; @@ -48,6 +37,17 @@ isoccupied(unsigned int t) { return False; } +static unsigned int +textnw(const char *text, unsigned int len) { + XRectangle r; + + if(dc.font.set) { + XmbTextExtents(dc.font.set, text, len, NULL, &r); + return r.width; + } + return XTextWidth(dc.font.xfont, text, len); +} + /* extern */ void @@ -79,7 +79,12 @@ drawstatus(void) { drawtext(stext, dc.norm); if((dc.w = dc.x - x) > bh) { dc.x = x; - drawtext(sel ? sel->name : NULL, sel ? dc.sel : dc.norm); + if(sel) { + drawtext(sel->name, dc.sel); + drawsquare(sel->ismax, sel->isuntiled, dc.sel); + } + else + drawtext(NULL, dc.norm); } XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, sw, bh, 0, 0); XSync(dpy, False);