summaryrefslogtreecommitdiffstats
path: root/draw.c
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-07-20 15:07:35 +0200
committerarg@10ksloc.org <unknown>2006-07-20 15:07:35 +0200
commit4688ad181da14be36e034918580ec0ce5968ffdb (patch)
treee919b8e6e89400a8b5dac01fa611090f139d5b5f /draw.c
parentcleaned up code (diff)
downloaddwm-4688ad181da14be36e034918580ec0ce5968ffdb.tar.gz
dwm-4688ad181da14be36e034918580ec0ce5968ffdb.zip
made status bar drawing more robust, implemented togglemax and togglemode, works quite well
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/draw.c b/draw.c
index b5d8bd2..0c920e5 100644
--- a/draw.c
+++ b/draw.c
@@ -107,7 +107,7 @@ drawall()
107void 107void
108drawstatus() 108drawstatus()
109{ 109{
110 int i; 110 int i, x;
111 Bool istile = arrange == dotile; 111 Bool istile = arrange == dotile;
112 112
113 dc.x = dc.y = 0; 113 dc.x = dc.y = 0;
@@ -123,15 +123,14 @@ drawstatus()
123 else 123 else
124 drawtext(tags[i], (i != tsel), True); 124 drawtext(tags[i], (i != tsel), True);
125 } 125 }
126 if(sel) { 126 x = dc.x + dc.w;
127 dc.x += dc.w;
128 dc.w = textw(sel->name);
129 drawtext(sel->name, istile, True);
130 }
131 dc.w = textw(stext); 127 dc.w = textw(stext);
132 dc.x = bx + bw - dc.w; 128 dc.x = bx + bw - dc.w;
133 drawtext(stext, !istile, False); 129 drawtext(stext, !istile, False);
134 130 if(sel && ((dc.w = dc.x - x) >= bh)) {
131 dc.x = x;
132 drawtext(sel->name, istile, True);
133 }
135 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); 134 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0);
136 XSync(dpy, False); 135 XSync(dpy, False);
137} 136}