From 2ca4766bb8947bf58237e0b90cd714ea17a4bd16 Mon Sep 17 00:00:00 2001 From: Felix Weilbach Date: Fri, 30 Apr 2021 22:43:16 +0200 Subject: [PATCH] Better name for variable Signed-off-by: Felix Weilbach --- include/swaybar/bar.h | 3 +-- swaybar/ipc.c | 4 ++-- swaybar/render.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h index 246dcf1b8..098d5b7ad 100644 --- a/include/swaybar/bar.h +++ b/include/swaybar/bar.h @@ -50,8 +50,7 @@ struct swaybar { struct swaybar_window *focused_window; - // TOOD: Better name - bool workspace_changed; + bool workspace_window_title_sync; #if HAVE_TRAY struct swaybar_tray *tray; diff --git a/swaybar/ipc.c b/swaybar/ipc.c index 7b6e71f74..a9698cdcf 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -657,7 +657,7 @@ bool ipc_set_focused_window(struct swaybar *bar) { } } - bar->workspace_changed = false; + bar->workspace_window_title_sync = true; // TODO: cache return true; } @@ -692,7 +692,7 @@ bool handle_ipc_readable(struct swaybar *bar) { bool bar_is_dirty = true; switch (resp->type) { case IPC_EVENT_WORKSPACE: - bar->workspace_changed = true; + bar->workspace_window_title_sync = false; bar_is_dirty = ipc_get_workspaces(bar); if (bar->config->window_title) { const bool focused_window_change = ipc_set_focused_window(bar); diff --git a/swaybar/render.c b/swaybar/render.c index bcf47f235..c49dd6dbc 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -849,7 +849,7 @@ static uint32_t render_to_cairo(struct render_context *ctx) { max_height = h > max_height ? h : max_height; } - if (!bar->workspace_changed && output->focused) { + if (bar->workspace_window_title_sync && output->focused) { uint32_t h = render_focused_window_icon(cairo, output, &x); max_height = h > max_height ? h : max_height; old_x -= x;