tree: make surface visibility tracking more robust
This commit is contained in:
parent
be0935c8dd
commit
ba98103233
26 changed files with 313 additions and 144 deletions
11
src/state.rs
11
src/state.rs
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue