summaryrefslogtreecommitdiffhomepage
path: root/patch/bar_wintitle_floating.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-08-22 08:43:07 +0200
committerbakkeby <[email protected]>2020-08-22 08:43:07 +0200
commit110cc7d24042d88521a5edd67adf35eb5d949776 (patch)
tree9752df419472892b495ff7759fd4e786bbebb109 /patch/bar_wintitle_floating.c
parent81488b4862487c6debed8f447db217d2d2c78ecb (diff)
downloaddwm-flexipatch-110cc7d24042d88521a5edd67adf35eb5d949776.tar.gz
dwm-flexipatch-110cc7d24042d88521a5edd67adf35eb5d949776.zip
Added logic to auto-hide bars if nothing is drawn on them (e.g. for standalone bars that only show certain clients)
Diffstat (limited to 'patch/bar_wintitle_floating.c')
-rw-r--r--patch/bar_wintitle_floating.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/patch/bar_wintitle_floating.c b/patch/bar_wintitle_floating.c
index 3fea3c2..e4aea1d 100644
--- a/patch/bar_wintitle_floating.c
+++ b/patch/bar_wintitle_floating.c
@@ -8,8 +8,7 @@ int
draw_wintitle_floating(Bar *bar, BarDrawArg *a)
{
drw_rect(drw, a->x, 0, a->w, bh, 1, 1);
- calc_wintitle_floating(bar->mon, a->x, a->w, -1, flextitledraw, NULL);
- return a->x + a->w;
+ return calc_wintitle_floating(bar->mon, a->x, a->w, -1, flextitledraw, NULL);;
}
int
@@ -19,7 +18,7 @@ click_wintitle_floating(Bar *bar, Arg *arg, BarClickArg *a)
return ClkWinTitle;
}
-void
+int
calc_wintitle_floating(
Monitor *m, int offx, int tabw, int passx,
void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg), Arg *arg
@@ -36,9 +35,10 @@ calc_wintitle_floating(
}
if (!clientsnfloating)
- return;
+ return 0;
w = tabw / clientsnfloating;
r = tabw % clientsnfloating;
c = flextitledrawarea(m, m->clients, offx, r, w, clientsnfloating, SCHEMEFOR(GRP_FLOAT), 0, 0, 1, passx, tabfn, arg);
+ return 1;
} \ No newline at end of file