Mercurial > dwm-meillo
diff draw.c @ 124:75576e44c1d8
made status bar drawing more robust, implemented togglemax and togglemode, works quite well
author | arg@10ksloc.org |
---|---|
date | Thu, 20 Jul 2006 15:07:35 +0200 |
parents | 61490330e90a |
children | 9b9deafa0508 |
line wrap: on
line diff
--- a/draw.c Thu Jul 20 12:18:06 2006 +0200 +++ b/draw.c Thu Jul 20 15:07:35 2006 +0200 @@ -107,7 +107,7 @@ void drawstatus() { - int i; + int i, x; Bool istile = arrange == dotile; dc.x = dc.y = 0; @@ -123,15 +123,14 @@ 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); }