From ec35d74f1f64f9c4e4d048f4326bdeac15379855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 13 Sep 2023 23:58:23 +0800 Subject: [PATCH] wayland/idle-inhibit: Handle actor going away There were some fixes to how to handle actor going away and being recreated, but it didn't go all the way. This is the last step that should have been. Fixes: a3c62bf8aa ("wayland/idle-inhibit: Add state tracking to fix races") Related: https://bugzilla.redhat.com/show_bug.cgi?id=2238785 Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/3014 Part-of: --- src/wayland/meta-wayland-idle-inhibit.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/wayland/meta-wayland-idle-inhibit.c b/src/wayland/meta-wayland-idle-inhibit.c index b57f13718..bf9c1fa19 100644 --- a/src/wayland/meta-wayland-idle-inhibit.c +++ b/src/wayland/meta-wayland-idle-inhibit.c @@ -135,16 +135,14 @@ update_inhibitation (MetaWaylandIdleInhibitor *inhibitor) return; if (!inhibitor->surface || - !inhibitor->resource) + !inhibitor->resource || + !inhibitor->actor) { should_inhibit = FALSE; } else { - MetaSurfaceActor *actor; - - actor = meta_wayland_surface_get_actor (inhibitor->surface); - if (meta_surface_actor_is_effectively_obscured (actor)) + if (meta_surface_actor_is_effectively_obscured (inhibitor->actor)) should_inhibit = FALSE; else should_inhibit = TRUE;