kms: Enable VT switching

This commit is contained in:
Victoria Brekenfeld 2022-04-25 12:35:55 +02:00
parent f1f51e1714
commit b5ef2272c0
4 changed files with 94 additions and 75 deletions

View file

@ -102,7 +102,7 @@ pub fn init_backend(event_loop: &mut EventLoop<State>, state: &mut State) -> Res
let libinput_event_source = event_loop
.handle()
.insert_source(libinput_backend, move |event, _, state| {
state.common.process_input_event(event);
state.process_input_event(event);
for output in state.common.shell.outputs() {
state.backend.kms().schedule_render(output);
}
@ -624,6 +624,13 @@ impl Surface {
}
impl KmsState {
pub fn switch_vt(
&mut self,
num: i32,
) -> Result<(), anyhow::Error> {
self.session.change_vt(num).map_err(Into::into)
}
pub fn apply_config_for_output(
&mut self,
output: &Output,

View file

@ -276,7 +276,7 @@ impl State {
render_ping.ping();
}
WinitEvent::Refresh => render_ping.ping(),
WinitEvent::Input(event) => self.common.process_input_event(event),
WinitEvent::Input(event) => self.process_input_event(event),
_ => {}
};
}

View file

@ -410,7 +410,7 @@ impl State {
_ => {}
};
self.common.process_input_event(event);
self.process_input_event(event);
// TODO actually figure out the output
for output in self.common.shell.outputs() {
self.backend.schedule_render(output);