Bugfix: set group mask 1 by default, correctly compare modifiers

fixes #2002
This commit is contained in:
Michael Stapelberg
2015-10-29 08:47:36 +01:00
parent 0e5180cae9
commit 9692c1498b
2 changed files with 19 additions and 7 deletions

View File

@ -167,10 +167,10 @@ static Binding *get_binding(i3_event_state_mask_t state_filtered, bool is_releas
TAILQ_FOREACH(bind, bindings, bindings) {
bool state_matches;
if (bind->event_state_mask == 0) {
if ((bind->event_state_mask & 0xFFFF) == 0) {
/* Verify no modifiers are pressed. A bitwise AND would lead to
* false positives, see issue #2002. */
state_matches = (state_filtered == 0);
state_matches = (state_filtered == bind->event_state_mask);
} else {
state_matches = ((state_filtered & bind->event_state_mask) == bind->event_state_mask);
}