From 26daf75d93695d3ecd9418f4cfe8e0564ddc53db Mon Sep 17 00:00:00 2001 From: Hojjat Date: Thu, 10 Sep 2026 17:43:41 -0600 Subject: [PATCH] fix: forward release for modifier-only bindings --- src/input/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/input/mod.rs b/src/input/mod.rs index 45586b03..c48fea8d 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -2096,6 +2096,21 @@ impl State { backend_id, seat, modifiers, handle, serial, keycode, key_state, time, ); + // A modifier-only binding fires on the modifier's release, but its press was already + // forwarded. Forward the release too. + if key_state == KeyState::Released + && matches!(&result, FilterResult::Intercept(Some((_, binding))) if binding.key.is_none()) + { + seat.get_keyboard().unwrap().input_forward( + self, + keycode, + key_state, + serial, + time, + previous_modifiers != *modifiers, + ); + } + if (matches!(result, FilterResult::Forward) && !seat.get_keyboard().unwrap().is_grabbed() && !shortcuts_inhibited