Merge pull request #3475 from Gravemind/fix-i3bar-re-hidden-on-any-modifier

i3bar: Fix i3bar re-hidden by any modifier (#3474)
This commit is contained in:
Orestis 2018-10-23 18:41:11 +03:00 committed by GitHub
commit 5d70e2850f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View 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; xcb_xkb_state_notify_event_t *state = (xcb_xkb_state_notify_event_t *)event;
const uint32_t mod = (config.modifier & 0xFFFF); const uint32_t mod = (config.modifier & 0xFFFF);
mod_pressed = (mod != 0 && (state->mods & mod) == mod); const bool new_mod_pressed = (mod != 0 && (state->mods & mod) == mod);
if (state->xkbType == XCB_XKB_STATE_NOTIFY && config.modifier != XCB_NONE) { if (new_mod_pressed != mod_pressed) {
if (mod_pressed) { mod_pressed = new_mod_pressed;
activated_mode = false; if (state->xkbType == XCB_XKB_STATE_NOTIFY && config.modifier != XCB_NONE) {
unhide_bars(); if (mod_pressed) {
} else if (!activated_mode) { activated_mode = false;
hide_bars(); unhide_bars();
} else if (!activated_mode) {
hide_bars();
}
} }
} }