wayland: run idle code unconditionally
This commit is contained in:
parent
8da6285be8
commit
01e3930ced
5 changed files with 1 additions and 18 deletions
|
|
@ -32,10 +32,6 @@ pub trait Backend {
|
||||||
let _ = idle;
|
let _ = idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn supports_idle(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
fn import_environment(&self) -> bool {
|
fn import_environment(&self) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,10 +198,6 @@ impl Backend for MetalBackend {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn supports_idle(&self) -> bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
fn import_environment(&self) -> bool {
|
fn import_environment(&self) -> bool {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ impl Globals {
|
||||||
add_singleton!(WpContentTypeManagerV1Global);
|
add_singleton!(WpContentTypeManagerV1Global);
|
||||||
add_singleton!(XdgActivationV1Global);
|
add_singleton!(XdgActivationV1Global);
|
||||||
add_singleton!(ExtForeignToplevelListV1Global);
|
add_singleton!(ExtForeignToplevelListV1Global);
|
||||||
|
add_singleton!(ZwpIdleInhibitManagerV1Global);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_backend_singletons(&self, backend: &Rc<dyn Backend>) {
|
pub fn add_backend_singletons(&self, backend: &Rc<dyn Backend>) {
|
||||||
|
|
@ -174,9 +175,6 @@ impl Globals {
|
||||||
self.add_global_no_broadcast(&Rc::new($name::new(self.name())));
|
self.add_global_no_broadcast(&Rc::new($name::new(self.name())));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if backend.supports_idle() {
|
|
||||||
add_singleton!(ZwpIdleInhibitManagerV1Global);
|
|
||||||
}
|
|
||||||
if backend.supports_presentation_feedback() {
|
if backend.supports_presentation_feedback() {
|
||||||
add_singleton!(WpPresentationGlobal);
|
add_singleton!(WpPresentationGlobal);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -206,10 +206,6 @@ impl Backend for TestBackend {
|
||||||
|
|
||||||
fn set_idle(&self, _idle: bool) {}
|
fn set_idle(&self, _idle: bool) {}
|
||||||
|
|
||||||
fn supports_idle(&self) -> bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
fn supports_presentation_feedback(&self) -> bool {
|
fn supports_presentation_feedback(&self) -> bool {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,6 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
pub async fn idle(state: Rc<State>, backend: Rc<dyn Backend>) {
|
pub async fn idle(state: Rc<State>, backend: Rc<dyn Backend>) {
|
||||||
if !backend.supports_idle() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let timer = match TimerFd::new(c::CLOCK_MONOTONIC) {
|
let timer = match TimerFd::new(c::CLOCK_MONOTONIC) {
|
||||||
Ok(t) => t,
|
Ok(t) => t,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue