1
0
Fork 0
forked from wry/wry

autocommit 2022-04-14 19:52:11 CEST

This commit is contained in:
Julian Orth 2022-04-14 19:52:11 +02:00
parent 35ddfbcbe3
commit 5f13954dbc
27 changed files with 556 additions and 312 deletions

View file

@ -11,6 +11,9 @@ use {
};
pub async fn idle(state: Rc<State>, backend: Rc<dyn Backend>) {
if !backend.supports_idle() {
return;
}
let timer = match state.eng.timer(c::CLOCK_MONOTONIC) {
Ok(t) => t,
Err(e) => {

View file

@ -1,29 +0,0 @@
use {
crate::{
backends::{metal, x::XBackend},
state::State,
utils::errorfmt::ErrorFmt,
},
std::{future::pending, rc::Rc},
};
pub async fn start_backend(state: Rc<State>) {
log::info!("Trying to start X backend");
// let e = match XorgBackend::new(&state) {
// Ok(b) => {
// state.backend.set(Some(b));
// pending().await
// }
// Err(e) => e,
// };
let e = match XBackend::run(&state).await {
Ok(_) => pending().await,
Err(e) => e,
};
log::warn!("Could not start X backend: {}", ErrorFmt(e));
log::info!("Trying to start metal backend");
let e = metal::run(state.clone()).await;
log::error!("Metal backend failed: {}", ErrorFmt(e));
log::warn!("Shutting down");
state.el.stop();
}