summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-05-28 07:50:00 +0200
committerbakkeby <[email protected]>2020-05-28 10:50:33 +0200
commit643ea4d84fc7e01875aed9afa851d7114b476e0a (patch)
treebfb636002978ec1e7cf542f3f0f9928da8991960
parent2c9ff7453ab11b5d72c205eb8543400e38b15a60 (diff)
downloaddwm-flexipatch-643ea4d84fc7e01875aed9afa851d7114b476e0a.tar.gz
dwm-flexipatch-643ea4d84fc7e01875aed9afa851d7114b476e0a.zip
Awesomebar: patch to prevent visual glitches from uneven tabs count
-rw-r--r--dwm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index ea23d6d..ed6b9e1 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1396,7 +1396,7 @@ drawbar(Monitor *m)
int wdelta;
#endif // ALTERNATIVE_TAGS_PATCH
#if AWESOMEBAR_PATCH
- int n = 0, scm;
+ int n = 0, scm, remainder, tabw;
#elif FANCYBAR_PATCH
int ftw, mw, ew = 0;
int n = 0;
@@ -1565,6 +1565,8 @@ drawbar(Monitor *m)
{
#if AWESOMEBAR_PATCH
if (n > 0) {
+ remainder = w % n;
+ tabw = (1.0 / (double)n) * w + 1;
for (c = m->clients; c; c = c->next) {
if (!ISVISIBLE(c))
continue;
@@ -1586,8 +1588,13 @@ drawbar(Monitor *m)
#endif // VTCOLORS_PATCH
drw_setscheme(drw, scheme[scm]);
+ if (remainder >= 0) {
+ if (remainder == 0)
+ tabw--;
+ remainder--;
+ }
drw_text(drw, x, 0, (1.0 / (double)n) * w, bh, lrpad / 2, c->name, 0);
- x += (1.0 / (double)n) * w;
+ x += tabw;
}
} else {
#if VTCOLORS_PATCH