From 1844a5bafbf5a6ca0b40a1db4757d1bafb1805cd Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sat, 20 Oct 2018 21:12:54 +0100 Subject: swaybar: render with minimum height, nominally text height --- swaybar/render.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'swaybar/render.c') diff --git a/swaybar/render.c b/swaybar/render.c index 097eb462..85e7542f 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -448,7 +448,9 @@ static uint32_t render_to_cairo(cairo_t *cairo, struct swaybar_output *output) { } cairo_paint(cairo); - uint32_t max_height = 0; + int th; + get_text_size(cairo, config->font, NULL, &th, NULL, output->scale, false, ""); + uint32_t max_height = (th + WS_VERTICAL_PADDING * 4) / output->scale; /* * Each render_* function takes the actual height of the bar, and returns * the ideal height. If the actual height is too short, the render function -- cgit v1.2.3