From 7f2fd4a716a8def3d402563480c6f69f2704a942 Mon Sep 17 00:00:00 2001 From: Felix Weilbach Date: Sat, 1 May 2021 12:54:16 +0200 Subject: [PATCH] Cleanup render code Signed-off-by: Felix Weilbach --- swaybar/render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swaybar/render.c b/swaybar/render.c index 9ee40ae08..558683233 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -874,7 +874,7 @@ static uint32_t render_to_cairo(struct render_context *ctx) { max_height = h > max_height ? h : max_height; } - double old_x = x; + double max_width = x; x = 0; if (config->workspace_buttons) { struct swaybar_workspace *ws; @@ -889,10 +889,10 @@ static uint32_t render_to_cairo(struct render_context *ctx) { } if (bar->workspace_window_title_sync && output->focused) { - uint32_t h = render_focused_window_icon(cairo, output, &x, old_x); + uint32_t h = render_focused_window_icon(cairo, output, &x, max_width); max_height = h > max_height ? h : max_height; - old_x -= x; - h = render_focused_window_title(ctx, &x, old_x); + max_width -= x; + h = render_focused_window_title(ctx, &x, max_width); max_height = h > max_height ? h : max_height; }