fix: forward release for modifier-only bindings

This commit is contained in:
Hojjat 2026-09-10 17:43:41 -06:00 • committed by Victoria Brekenfeld
parent cd881a4df2
commit 26daf75d93

View file

@ -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