diff options
Diffstat (limited to 'sway/commands/bar/mode.c')
-rw-r--r-- | sway/commands/bar/mode.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c index 1081ad4b..8b3fb275 100644 --- a/sway/commands/bar/mode.c +++ b/sway/commands/bar/mode.c | |||
@@ -27,7 +27,7 @@ static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode | |||
27 | } | 27 | } |
28 | 28 | ||
29 | if (strcmp(old_mode, bar->mode) != 0) { | 29 | if (strcmp(old_mode, bar->mode) != 0) { |
30 | if (!config->reading) { | 30 | if (!config->current_bar) { |
31 | ipc_event_barconfig_update(bar); | 31 | ipc_event_barconfig_update(bar); |
32 | } | 32 | } |
33 | sway_log(SWAY_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id); | 33 | sway_log(SWAY_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id); |
@@ -51,6 +51,12 @@ struct cmd_results *bar_cmd_mode(int argc, char **argv) { | |||
51 | "Unexpected value %s in config mode", argv[1]); | 51 | "Unexpected value %s in config mode", argv[1]); |
52 | } | 52 | } |
53 | 53 | ||
54 | if (config->current_bar && argc == 2 && | ||
55 | strcmp(config->current_bar->id, argv[1]) != 0) { | ||
56 | return cmd_results_new(CMD_INVALID, "Conflicting bar ids: %s and %s", | ||
57 | config->current_bar->id, argv[1]); | ||
58 | } | ||
59 | |||
54 | const char *mode = argv[0]; | 60 | const char *mode = argv[0]; |
55 | if (config->reading) { | 61 | if (config->reading) { |
56 | error = bar_set_mode(config->current_bar, mode); | 62 | error = bar_set_mode(config->current_bar, mode); |