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

@ -125,9 +125,20 @@ impl Cursor for CursorSurface {
fn handle_set(self: Rc<Self>) {
self.surface.cursors.insert(self.seat.id(), self.clone());
if self.surface.cursors.is_not_empty() {
self.surface
.set_visible(self.surface.client.state.root_visible());
}
}
fn handle_unset(&self) {
self.surface.cursors.remove(&self.seat.id());
if self.surface.cursors.is_empty() {
self.surface.set_visible(false);
}
}
fn set_visible(&self, visible: bool) {
self.surface.set_visible(visible);
}
}