From f0254c913a62d8f32ffe80144d7fe3677d28539d Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Tue, 29 Sep 2026 09:46:17 -0700 Subject: [PATCH] keyboard: Send `modifers` after `key` Fixes https://github.com/Smithay/smithay/issues/2184. https://github.com/Smithay/smithay/commit/be920fb5d41096bc3d57e432b7035f4bc2a4e58c reversed the order of these. But this doesn't appear to be correct. I'm not sure exactly why the bug happens here, but sending `modifiers` after `key` seems to match Gnome. --- src/input/keyboard/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/input/keyboard/mod.rs b/src/input/keyboard/mod.rs index 530bddf4803f..e466419edcdf 100644 --- a/src/input/keyboard/mod.rs +++ b/src/input/keyboard/mod.rs @@ -1563,12 +1563,10 @@ impl KeyboardInnerHandle<'_, D> { keycode, }; - // Modifiers must be sent before the key event so the client resolves the key against the - // updated modifier state. + focus.key(self.seat, data, key, key_state, serial, time); if let Some(mods) = modifiers { focus.modifiers(self.seat, data, mods, serial); } - focus.key(self.seat, data, key, key_state, serial, time); } /// Iterate over the currently pressed keys.