inputd: Automatically switch to first vt once created

This commit is contained in:
bjorn3
2025-03-02 15:51:32 +01:00
parent 9779d1884e
commit de0239d3ed
3 changed files with 5 additions and 7 deletions
-4
View File
@@ -26,16 +26,12 @@ fn inner(daemon: redox_daemon::Daemon) -> ! {
let mut scheme = FbbootlogScheme::new();
let mut inputd_control_handle = inputd::ControlHandle::new().unwrap();
// This is not possible for now as fbbootlogd needs to open new displays at runtime for graphics
// driver handoff. In the future inputd may directly pass a handle to the display instead.
//libredox::call::setrens(0, 0).expect("fbbootlogd: failed to enter null namespace");
daemon.ready().expect("failed to notify parent");
inputd_control_handle.activate_vt(1).unwrap();
loop {
let request = match socket
.next_request(SignalBehavior::Restart)
-3
View File
@@ -83,7 +83,6 @@ fn main() {
}
fn inner(daemon: redox_daemon::Daemon, framebuffers: Vec<FrameBuffer>, spec: &[()]) -> ! {
let mut inputd_display_handle = DisplayHandle::new_early("vesa").unwrap();
let mut inputd_control_handle = inputd::ControlHandle::new().unwrap();
for &() in spec.iter() {
inputd_display_handle.register_vt().unwrap();
@@ -121,8 +120,6 @@ fn inner(daemon: redox_daemon::Daemon, framebuffers: Vec<FrameBuffer>, spec: &[(
daemon.ready().expect("failed to notify parent");
inputd_control_handle.activate_vt(1).unwrap();
let all = [Source::Input, Source::Scheme];
for event in all
.into_iter()
+5
View File
@@ -266,6 +266,11 @@ impl Scheme for InputScheme {
let vt = self.next_vt_id.fetch_add(1, Ordering::SeqCst);
log::info!("inputd: created VT #{vt} for {device}");
self.vts.insert(vt, Vt::new(device.clone()));
if self.active_vt.is_none() {
self.switch_vt(vt)?;
}
Ok(vt)
} else if buf.len() % size_of::<VtEvent>() == 0 {
let copy = core::cmp::min(pending.len(), buf.len() / size_of::<VtEvent>());