summaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dwm.c b/dwm.c
index a416cf5d..2f262d9f 100644
--- a/dwm.c
+++ b/dwm.c
@@ -754,8 +754,11 @@ drawbar(Monitor *m)
if ((w = m->ww - tw - x) > bh) {
if (m->sel) {
+ int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
+ /* make sure name will not overlap on tags even when it is very long */
+ mid = mid >= lrpad / 2 ? mid : lrpad / 2;
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
- drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
+ drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
if (m->sel->isfloating)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
} else {