about summary refs log tree commit diff stats
path: root/draw.c
diff options
context:
space:
mode:
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()
 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);
 }
a id='n119' href='#n119'>119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162