]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: Fix i3bar re-hidden by any modifier (#3474) 3475/head
authorGravemind <gravemind2a@gmail.com>
Tue, 23 Oct 2018 13:15:07 +0000 (15:15 +0200)
committerGravemind <gravemind2a@gmail.com>
Tue, 23 Oct 2018 13:17:30 +0000 (15:17 +0200)
The bug was introduced in 4.15-next fe6b3b7474

i3bar/src/xcb.c

index f4509c26fbecaec36bae91c6824178d060b4495d..39368c88bdd673546572d875e9866a1fad288628 100644 (file)
@@ -1106,13 +1106,16 @@ 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();
+                    }
                 }
             }