summaryrefslogtreecommitdiff
path: root/sway/commands/bar/hidden_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/bar/hidden_state.c')
-rw-r--r--sway/commands/bar/hidden_state.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c
index 0b49aa6b..6641f184 100644
--- a/sway/commands/bar/hidden_state.c
+++ b/sway/commands/bar/hidden_state.c
@@ -6,7 +6,8 @@
#include "sway/ipc-server.h"
#include "log.h"
-static struct cmd_results *bar_set_hidden_state(struct bar_config *bar, const char *hidden_state) {
+static struct cmd_results *bar_set_hidden_state(struct bar_config *bar,
+ const char *hidden_state) {
char *old_state = bar->hidden_state;
if (strcasecmp("toggle", hidden_state) == 0 && !config->reading) {
if (strcasecmp("hide", bar->hidden_state) == 0) {
@@ -19,16 +20,16 @@ static struct cmd_results *bar_set_hidden_state(struct bar_config *bar, const ch
} else if (strcasecmp("show", hidden_state) == 0) {
bar->hidden_state = strdup("show");
} else {
- return cmd_results_new(CMD_INVALID, "hidden_state", "Invalid value %s", hidden_state);
+ return cmd_results_new(CMD_INVALID, "hidden_state",
+ "Invalid value %s", hidden_state);
}
-
if (strcmp(old_state, bar->hidden_state) != 0) {
if (!config->reading) {
ipc_event_barconfig_update(bar);
}
- sway_log(L_DEBUG, "Setting hidden_state: '%s' for bar: %s", bar->hidden_state, bar->id);
+ wlr_log(L_DEBUG, "Setting hidden_state: '%s' for bar: %s",
+ bar->hidden_state, bar->id);
}
-
// free old mode
free(old_state);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
@@ -42,13 +43,12 @@ struct cmd_results *bar_cmd_hidden_state(int argc, char **argv) {
if ((error = checkarg(argc, "hidden_state", EXPECTED_LESS_THAN, 3))) {
return error;
}
-
if (config->reading && argc > 1) {
- return cmd_results_new(CMD_INVALID, "hidden_state", "Unexpected value %s in config mode", argv[1]);
+ return cmd_results_new(CMD_INVALID, "hidden_state",
+ "Unexpected value %s in config mode", argv[1]);
}
const char *state = argv[0];
-
if (config->reading) {
return bar_set_hidden_state(config->current_bar, state);
}
@@ -57,10 +57,8 @@ struct cmd_results *bar_cmd_hidden_state(int argc, char **argv) {
if (argc == 2) {
id = argv[1];
}
-
- int i;
struct bar_config *bar;
- for (i = 0; i < config->bars->length; ++i) {
+ for (int i = 0; i < config->bars->length; ++i) {
bar = config->bars->items[i];
if (id && strcmp(id, bar->id) == 0) {
return bar_set_hidden_state(bar, state);
@@ -71,9 +69,5 @@ struct cmd_results *bar_cmd_hidden_state(int argc, char **argv) {
return error;
}
}
-
- // active bar modifiers might have changed.
- update_active_bar_modifiers();
-
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}