aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/bar
diff options
context:
space:
mode:
authorLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2019-02-10 17:04:12 +0100
committerLibravatar emersion <contact@emersion.fr>2019-02-10 17:13:11 +0100
commit605e515a9324c3e314939d21f1ea13b29881e100 (patch)
treed25161803fa047ae74297dd374005fe3915fd4f9 /sway/commands/bar
parentcontainer_at_stacked: skip titles when zero pixels (diff)
downloadsway-605e515a9324c3e314939d21f1ea13b29881e100.tar.gz
sway-605e515a9324c3e314939d21f1ea13b29881e100.tar.zst
sway-605e515a9324c3e314939d21f1ea13b29881e100.zip
fix double free for mode toggle if bar was invisible
If the bar was set to "invisible" and subsequently "toggle" was send twice, the new mode was never set and the bar->mode was double freed. Fix this by not requiring the bar->mode to be "hide" and instead show it unconditionally, because it was either hidden or invisible. Fixes #3637
Diffstat (limited to 'sway/commands/bar')
-rw-r--r--sway/commands/bar/mode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c
index d89ddf24..68a80abf 100644
--- a/sway/commands/bar/mode.c
+++ b/sway/commands/bar/mode.c
@@ -11,7 +11,7 @@ static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode
11 if (strcasecmp("toggle", mode) == 0 && !config->reading) { 11 if (strcasecmp("toggle", mode) == 0 && !config->reading) {
12 if (strcasecmp("dock", bar->mode) == 0) { 12 if (strcasecmp("dock", bar->mode) == 0) {
13 bar->mode = strdup("hide"); 13 bar->mode = strdup("hide");
14 } else if (strcasecmp("hide", bar->mode) == 0) { 14 } else{
15 bar->mode = strdup("dock"); 15 bar->mode = strdup("dock");
16 } 16 }
17 } else if (strcasecmp("dock", mode) == 0) { 17 } else if (strcasecmp("dock", mode) == 0) {