X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=draw.c;h=0c920e5d1c063d3b63b0874d309e8cd2c1416b50;hp=b5d8bd2eed8bfb99af76dc480401129c556bfe81;hb=4688ad181da14be36e034918580ec0ce5968ffdb;hpb=dc5d967ee61046f899b3b49daeb9268c8161844a diff --git a/draw.c b/draw.c index b5d8bd2..0c920e5 100644 --- a/draw.c +++ b/draw.c @@ -107,7 +107,7 @@ drawall() void drawstatus() { - int i; + int i, x; Bool istile = arrange == dotile; dc.x = dc.y = 0; @@ -123,15 +123,14 @@ drawstatus() else drawtext(tags[i], (i != tsel), True); } - if(sel) { - dc.x += dc.w; - dc.w = textw(sel->name); - drawtext(sel->name, istile, True); - } + x = dc.x + dc.w; dc.w = textw(stext); dc.x = bx + bw - dc.w; drawtext(stext, !istile, False); - + if(sel && ((dc.w = dc.x - x) >= bh)) { + dc.x = x; + drawtext(sel->name, istile, True); + } XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); XSync(dpy, False); }