summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksei Bavshin <alebastr89@gmail.com>2021-11-22 20:52:19 -0800
committerSimon Ser <contact@emersion.fr>2021-11-25 11:32:46 +0100
commit94dc486f0e2eb1693b64dcc84309794f17d0f79b (patch)
treeaf18a3583029f03ea4c572bd263dda9d67761204
parenta23cdbbea145e0890627743d316c0ab6fe6c9c1f (diff)
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.
-rw-r--r--sway/commands/bar/hidden_state.c2
-rw-r--r--sway/commands/bar/mode.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c
index 1f08a5d2e..8b661e3a1 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 8b3fb275a..7c2f423bb 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;