Added logic to auto-hide bars if nothing is drawn on them (e.g. for standalone bars that only show certain clients)

This commit is contained in:
bakkeby
2020-08-22 08:43:07 +02:00
parent 81488b4862
commit 110cc7d240
18 changed files with 91 additions and 69 deletions

View File

@@ -17,7 +17,7 @@ int
draw_systray(Bar *bar, BarDrawArg *a)
{
if (!showsystray)
return a->x;
return 0;
XSetWindowAttributes wa;
Client *i;
@@ -61,7 +61,7 @@ draw_systray(Bar *bar, BarDrawArg *a)
fprintf(stderr, "dwm: unable to obtain system tray.\n");
free(systray);
systray = NULL;
return a->x;
return 0;
}
}
@@ -86,7 +86,7 @@ draw_systray(Bar *bar, BarDrawArg *a)
}
XMoveResizeWindow(dpy, systray->win, bar->bx + a->x + lrpad / 2, (w ? bar->by : -bar->by), MAX(w, 1), bar->bh);
return a->x + a->w;
return w;
}
int