Better name for variable

Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
This commit is contained in:
Felix Weilbach 2021-04-30 22:43:16 +02:00
parent d5aec8d1c5
commit 2ca4766bb8
3 changed files with 4 additions and 5 deletions

View file

@ -50,8 +50,7 @@ struct swaybar {
struct swaybar_window *focused_window; struct swaybar_window *focused_window;
// TOOD: Better name bool workspace_window_title_sync;
bool workspace_changed;
#if HAVE_TRAY #if HAVE_TRAY
struct swaybar_tray *tray; struct swaybar_tray *tray;

View file

@ -657,7 +657,7 @@ bool ipc_set_focused_window(struct swaybar *bar) {
} }
} }
bar->workspace_changed = false; bar->workspace_window_title_sync = true;
// TODO: cache // TODO: cache
return true; return true;
} }
@ -692,7 +692,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
bool bar_is_dirty = true; bool bar_is_dirty = true;
switch (resp->type) { switch (resp->type) {
case IPC_EVENT_WORKSPACE: case IPC_EVENT_WORKSPACE:
bar->workspace_changed = true; bar->workspace_window_title_sync = false;
bar_is_dirty = ipc_get_workspaces(bar); bar_is_dirty = ipc_get_workspaces(bar);
if (bar->config->window_title) { if (bar->config->window_title) {
const bool focused_window_change = ipc_set_focused_window(bar); const bool focused_window_change = ipc_set_focused_window(bar);

View file

@ -849,7 +849,7 @@ static uint32_t render_to_cairo(struct render_context *ctx) {
max_height = h > max_height ? h : max_height; 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); uint32_t h = render_focused_window_icon(cairo, output, &x);
max_height = h > max_height ? h : max_height; max_height = h > max_height ? h : max_height;
old_x -= x; old_x -= x;