From 94dc486f0e2eb1693b64dcc84309794f17d0f79b Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 22 Nov 2021 20:52:19 -0800 Subject: [PATCH] ipc: make `bar mode|hidden_state` behave as documented sway-bar(5) says: > For compatibility with i3, bar mode [] syntax is > supported along with the sway only bar mode syntax. while the actual behavior is that `bar_cmd_mode` ignores already selected `config->current_bar` and applies the change to all the configured bars. --- sway/commands/bar/hidden_state.c | 2 +- sway/commands/bar/mode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c index 1f08a5d2..8b661e3a 100644 --- a/sway/commands/bar/hidden_state.c +++ b/sway/commands/bar/hidden_state.c @@ -54,7 +54,7 @@ struct cmd_results *bar_cmd_hidden_state(int argc, char **argv) { } const char *state = argv[0]; - if (config->reading) { + if (config->current_bar) { error = bar_set_hidden_state(config->current_bar, state); } else { const char *id = argc == 2 ? argv[1] : NULL; diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c index 8b3fb275..7c2f423b 100644 --- a/sway/commands/bar/mode.c +++ b/sway/commands/bar/mode.c @@ -58,7 +58,7 @@ struct cmd_results *bar_cmd_mode(int argc, char **argv) { } const char *mode = argv[0]; - if (config->reading) { + if (config->current_bar) { error = bar_set_mode(config->current_bar, mode); } else { const char *id = argc == 2 ? argv[1] : NULL;