sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 94dc486f0e2eb1693b64dcc84309794f17d0f79b
parent a23cdbbea145e0890627743d316c0ab6fe6c9c1f
Author: Aleksei Bavshin <alebastr89@gmail.com>
Date:   Mon, 22 Nov 2021 20:52:19 -0800

ipc: make `bar <bar_id> mode|hidden_state` behave as documented

sway-bar(5) says:

> For compatibility with i3, bar mode <mode> [<bar-id>] syntax is
> supported along with the sway only bar <bar-id> mode <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.

Diffstat:
Msway/commands/bar/hidden_state.c | 2+-
Msway/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 @@ -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 @@ -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;