mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Awesomebar: patch to prevent visual glitches from uneven tabs count
This commit is contained in:
parent
2c9ff7453a
commit
643ea4d84f
11
dwm.c
11
dwm.c
@ -1396,7 +1396,7 @@ drawbar(Monitor *m)
|
|||||||
int wdelta;
|
int wdelta;
|
||||||
#endif // ALTERNATIVE_TAGS_PATCH
|
#endif // ALTERNATIVE_TAGS_PATCH
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
int n = 0, scm;
|
int n = 0, scm, remainder, tabw;
|
||||||
#elif FANCYBAR_PATCH
|
#elif FANCYBAR_PATCH
|
||||||
int ftw, mw, ew = 0;
|
int ftw, mw, ew = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
@ -1565,6 +1565,8 @@ drawbar(Monitor *m)
|
|||||||
{
|
{
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
|
remainder = w % n;
|
||||||
|
tabw = (1.0 / (double)n) * w + 1;
|
||||||
for (c = m->clients; c; c = c->next) {
|
for (c = m->clients; c; c = c->next) {
|
||||||
if (!ISVISIBLE(c))
|
if (!ISVISIBLE(c))
|
||||||
continue;
|
continue;
|
||||||
@ -1586,8 +1588,13 @@ drawbar(Monitor *m)
|
|||||||
#endif // VTCOLORS_PATCH
|
#endif // VTCOLORS_PATCH
|
||||||
|
|
||||||
drw_setscheme(drw, scheme[scm]);
|
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);
|
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 {
|
} else {
|
||||||
#if VTCOLORS_PATCH
|
#if VTCOLORS_PATCH
|
||||||
|
Loading…
Reference in New Issue
Block a user