]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #3475 from Gravemind/fix-i3bar-re-hidden-on-any-modifier
authorOrestis <orestisf1993@gmail.com>
Tue, 23 Oct 2018 15:41:11 +0000 (18:41 +0300)
committerGitHub <noreply@github.com>
Tue, 23 Oct 2018 15:41:11 +0000 (18:41 +0300)
i3bar: Fix i3bar re-hidden by any modifier (#3474)

i3bar/src/xcb.c

index d43a4bdd5373b53d1d16bb9dee8cdf0ae6afd945..c0486181b02933db87200396c318e0ee322924e2 100644 (file)
@@ -1067,13 +1067,16 @@ static void xcb_prep_cb(struct ev_loop *loop, ev_prepare *watcher, int revents)
 
             xcb_xkb_state_notify_event_t *state = (xcb_xkb_state_notify_event_t *)event;
             const uint32_t mod = (config.modifier & 0xFFFF);
-            mod_pressed = (mod != 0 && (state->mods & mod) == mod);
-            if (state->xkbType == XCB_XKB_STATE_NOTIFY && config.modifier != XCB_NONE) {
-                if (mod_pressed) {
-                    activated_mode = false;
-                    unhide_bars();
-                } else if (!activated_mode) {
-                    hide_bars();
+            const bool new_mod_pressed = (mod != 0 && (state->mods & mod) == mod);
+            if (new_mod_pressed != mod_pressed) {
+                mod_pressed = new_mod_pressed;
+                if (state->xkbType == XCB_XKB_STATE_NOTIFY && config.modifier != XCB_NONE) {
+                    if (mod_pressed) {
+                        activated_mode = false;
+                        unhide_bars();
+                    } else if (!activated_mode) {
+                        hide_bars();
+                    }
                 }
             }