fix compilation errors

This commit is contained in:
Ferdinand Schober
2024-07-01 10:02:39 +02:00
parent e2162b905a
commit 08f24293f8
7 changed files with 73 additions and 23 deletions

View File

@@ -2,7 +2,9 @@ use async_trait::async_trait;
use std::future;
use crate::{
client::{ClientEvent, ClientHandle}, config::EmulationBackend, event::Event
client::{ClientEvent, ClientHandle},
config::EmulationBackend,
event::Event,
};
use anyhow::Result;
@@ -43,7 +45,18 @@ pub trait InputEmulation: Send {
async fn destroy(&mut self);
}
pub async fn create(backend: Option<EmulationBackend>) -> Result<Box<dyn InputEmulation>, EmulationCreationError> {
pub async fn create(
backend: Option<EmulationBackend>,
) -> Result<Box<dyn InputEmulation>, EmulationCreationError> {
if let Some(backend) = backend {
return match backend {
EmulationBackend::Libei => Ok(Box::new(libei::LibeiEmulation::new().await?)),
EmulationBackend::Wlroots => Ok(Box::new(wlroots::WlrootsEmulation::new()?)),
EmulationBackend::X11 => Ok(Box::new(x11::X11Emulation::new()?)),
EmulationBackend::Dummy => Ok(Box::new(dummy::DummyEmulation::new())),
};
}
#[cfg(windows)]
match windows::WindowsEmulation::new() {
Ok(c) => return Ok(Box::new(c)),