From 2bd3639fbb58e92d4d3babde0956bb9f003c0335 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 23 May 2017 08:28:56 +0200 Subject: [PATCH] Fix --release bindings broken by previous commit fixes #2559 --- src/bindings.c | 4 ++- testcases/t/264-keypress-numlock.t | 45 +++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/bindings.c b/src/bindings.c index 8d54c6eb..a8b897af 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -274,7 +274,9 @@ static Binding *get_binding(i3_event_state_mask_t state_filtered, bool is_releas break; } } - if (!found_keycode) { + if (!found_keycode && + (bind->release != B_UPON_KEYRELEASE_IGNORE_MODS || + !is_release)) { continue; } } diff --git a/testcases/t/264-keypress-numlock.t b/testcases/t/264-keypress-numlock.t index 464fe748..90a403af 100644 --- a/testcases/t/264-keypress-numlock.t +++ b/testcases/t/264-keypress-numlock.t @@ -206,6 +206,49 @@ is(scalar @i3test::XTEST::binding_events, 12, 'Received exactly 12 binding event exit_gracefully($pid); +################################################################################ +# Verify bindings for modifiers work +################################################################################ + +$config = <