Fix uinput server in wayland clien

This commit is contained in:
asur4s 2022-09-04 04:20:21 -04:00
parent 7c2f26eab2
commit 7a1b1d87e9

View File

@ -154,7 +154,20 @@ impl Client {
return Err(err);
}
}
Ok(x) => Ok(x),
Ok(x) => {
#[cfg(target_os = "linux")]
if !*IS_X11.lock().unwrap() {
let keyboard = super::uinput::client::UInputKeyboard::new().await?;
log::info!("UInput keyboard created");
let mouse = super::uinput::client::UInputMouse::new().await?;
log::info!("UInput mouse created");
let mut en = ENIGO.lock().unwrap();
en.set_uinput_keyboard(Some(Box::new(keyboard)));
en.set_uinput_mouse(Some(Box::new(mouse)));
}
Ok(x)},
}
}