forge
Explore
Log in

Don't you dare go Hollow

input: Set repeat: false for hardcoded VT switch and suspend

Browse files at this commit

90af637e466687ebce85d5e037c83871a1c0376aIvan MolodetskikhParent: e53294b
src/input/mod.rsmodified+12 -0
@@ -718,13 +718,25 @@ impl State {
718718 }
719719 Action::ChangeVt(vt) => {
720720 self.backend.change_vt(vt);
721+
721722 // Changing VT may not deliver the key releases, so clear the state.
722723 self.niri.suppressed_keys.clear();
724+
725+ // Stop ongoing key repeat if any.
726+ if let Some(token) = self.niri.bind_repeat_timer.take() {
727+ self.niri.event_loop.remove(token);
728+ }
723729 }
724730 Action::Suspend => {
725731 self.backend.suspend();
732+
726733 // Suspend may not deliver the key releases, so clear the state.
727734 self.niri.suppressed_keys.clear();
735+
736+ // Stop ongoing key repeat if any.
737+ if let Some(token) = self.niri.bind_repeat_timer.take() {
738+ self.niri.event_loop.remove(token);
739+ }
728740 }
729741 Action::PowerOffMonitors => {
730742 self.niri.deactivate_monitors(&mut self.backend);