mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Implement TTY switching
Having to pass backend around turns out to be a problem...
This commit is contained in:
+9
-1
@@ -117,7 +117,9 @@ impl Tty {
|
||||
let input_backend = LibinputInputBackend::new(libinput.clone());
|
||||
event_loop
|
||||
.insert_source(input_backend, |event, _, data| {
|
||||
data.niri.process_input_event(event)
|
||||
let tty = data.tty.as_mut().unwrap();
|
||||
let mut change_vt = |vt| tty.change_vt(vt);
|
||||
data.niri.process_input_event(&mut change_vt, event);
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
@@ -440,4 +442,10 @@ impl Tty {
|
||||
)?;
|
||||
Ok(compositor)
|
||||
}
|
||||
|
||||
fn change_vt(&mut self, vt: i32) {
|
||||
if let Err(err) = self.session.change_vt(vt) {
|
||||
error!("error changing VT: {err}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user