drivers/graphics: Directly pass scheme name to DisplayHandle::new

This commit is contained in:
bjorn3
2026-03-04 20:02:37 +01:00
parent f518db3d6a
commit 3c79908b5a
5 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -153,13 +153,13 @@ pub struct KeymapActivate {
pub struct DisplayHandle(File);
impl DisplayHandle {
pub fn new<S: Into<String>>(device_name: S) -> io::Result<Self> {
let path = format!("/scheme/input/handle/display/{}", device_name.into());
pub fn new<S: Into<String>>(scheme_name: S) -> io::Result<Self> {
let path = format!("/scheme/input/handle/{}", scheme_name.into());
Ok(Self(File::open(path)?))
}
pub fn new_early<S: Into<String>>(device_name: S) -> io::Result<Self> {
let path = format!("/scheme/input/handle_early/display/{}", device_name.into());
pub fn new_early<S: Into<String>>(scheme_name: S) -> io::Result<Self> {
let path = format!("/scheme/input/handle_early/{}", scheme_name.into());
Ok(Self(File::open(path)?))
}
+3 -3
View File
@@ -209,7 +209,7 @@ impl SchemeSync for InputScheme {
}
}
"handle" | "handle_early" => {
let display = path_parts.collect::<Vec<_>>().join(".");
let display = path_parts.next().ok_or(SysError::new(EINVAL))?;
let needs_handoff = match command {
"handle_early" => self.display.is_none(),
@@ -227,7 +227,7 @@ impl SchemeSync for InputScheme {
if needs_handoff {
self.has_new_events = true;
self.display = Some(display.clone());
self.display = Some(display.to_owned());
for handle in self.handles.values_mut() {
match handle {
@@ -258,7 +258,7 @@ impl SchemeSync for InputScheme {
vec![]
},
notified: false,
device: display,
device: display.to_owned(),
is_earlyfb: command == "handle_early",
}
}