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 {
718 }718 }
719 Action::ChangeVt(vt) => {719 Action::ChangeVt(vt) => {
720 self.backend.change_vt(vt);720 self.backend.change_vt(vt);
721+
721 // Changing VT may not deliver the key releases, so clear the state.722 // Changing VT may not deliver the key releases, so clear the state.
722 self.niri.suppressed_keys.clear();723 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+ }
723 }729 }
724 Action::Suspend => {730 Action::Suspend => {
725 self.backend.suspend();731 self.backend.suspend();
732+
726 // Suspend may not deliver the key releases, so clear the state.733 // Suspend may not deliver the key releases, so clear the state.
727 self.niri.suppressed_keys.clear();734 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+ }
728 }740 }
729 Action::PowerOffMonitors => {741 Action::PowerOffMonitors => {
730 self.niri.deactivate_monitors(&mut self.backend);742 self.niri.deactivate_monitors(&mut self.backend);