From 90af637e466687ebce85d5e037c83871a1c0376a Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 12 Oct 2026 08:52:23 +0300 Subject: [PATCH] input: Set repeat: false for hardcoded VT switch and suspend --- src/input/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/input/mod.rs b/src/input/mod.rs index c0a855a9..0ca0bb51 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -718,13 +718,25 @@ impl State { } Action::ChangeVt(vt) => { self.backend.change_vt(vt); + // Changing VT may not deliver the key releases, so clear the state. self.niri.suppressed_keys.clear(); + + // Stop ongoing key repeat if any. + if let Some(token) = self.niri.bind_repeat_timer.take() { + self.niri.event_loop.remove(token); + } } Action::Suspend => { self.backend.suspend(); + // Suspend may not deliver the key releases, so clear the state. self.niri.suppressed_keys.clear(); + + // Stop ongoing key repeat if any. + if let Some(token) = self.niri.bind_repeat_timer.take() { + self.niri.event_loop.remove(token); + } } Action::PowerOffMonitors => { self.niri.deactivate_monitors(&mut self.backend);