aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/bar.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-04-24 00:25:49 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-04-24 07:14:48 -0600
commit583ceff6f6129b5c569ad1eb499cffc526a14d1c (patch)
treebffca87361c63ccf1227436a7437b5ea4d5a0902 /swaybar/bar.c
parentUpdate for wlroots#1660 (diff)
downloadsway-583ceff6f6129b5c569ad1eb499cffc526a14d1c.tar.gz
sway-583ceff6f6129b5c569ad1eb499cffc526a14d1c.tar.zst
sway-583ceff6f6129b5c569ad1eb499cffc526a14d1c.zip
swaybar: hide mode visibility improvements
This allows swaybar to become visible when the mode changes (to any mode other than the default). swaybar will be hidden again when the modifier is pressed and released or when switching back to the default mode. This also applies the same logic to visible by urgency to hide swaybar when the modifier is pressed and released. These changes are to match i3's behavior.
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r--swaybar/bar.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index ca7cd88c..a95464f5 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -148,7 +148,8 @@ bool determine_bar_visibility(struct swaybar *bar, bool moving_layer) {
148 struct swaybar_config *config = bar->config; 148 struct swaybar_config *config = bar->config;
149 bool visible = !(strcmp(config->mode, "invisible") == 0 || 149 bool visible = !(strcmp(config->mode, "invisible") == 0 ||
150 (strcmp(config->mode, config->hidden_state) == 0 // both "hide" 150 (strcmp(config->mode, config->hidden_state) == 0 // both "hide"
151 && !bar->visible_by_modifier && !bar->visible_by_urgency)); 151 && !bar->visible_by_modifier && !bar->visible_by_urgency
152 && !bar->visible_by_mode));
152 153
153 // Create/destroy layer surfaces as needed 154 // Create/destroy layer surfaces as needed
154 struct swaybar_output *output; 155 struct swaybar_output *output;