1
0
Fork 0
forked from wry/wry

tree: make surface visibility tracking more robust

This commit is contained in:
Julian Orth 2024-03-29 20:07:28 +01:00
parent be0935c8dd
commit ba98103233
26 changed files with 313 additions and 144 deletions

View file

@ -205,6 +205,7 @@ pub struct IdleState {
pub timeout_changed: Cell<bool>,
pub inhibitors: CopyHashMap<IdleInhibitorId, Rc<ZwpIdleInhibitorV1>>,
pub inhibitors_changed: Cell<bool>,
pub backend_idle: Cell<bool>,
}
impl IdleState {
@ -960,6 +961,16 @@ impl State {
log::error!("Could not signal sync obj: {}", ErrorFmt(e));
}
}
pub fn set_backend_idle(&self, idle: bool) {
if self.idle.backend_idle.replace(idle) != idle {
self.root.update_visible(self);
}
}
pub fn root_visible(&self) -> bool {
!self.idle.backend_idle.get()
}
}
#[derive(Debug, Error)]