From e8b43d3b1bb19ca487ef15a6668c0c436eb56df5 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Sat, 2 Mar 2024 22:33:13 +0100 Subject: [PATCH] surface-actor: Add NULL check for stage In some cases Wayland surface actors are not decendents of the stage, notably subsurfaces without a parent surface. The code changes in the mentioned commits dropped the previously existing check for that - readd it. Fixes: 627ab24721 (surface-actor: Add meta_surface_actor_schedule_update()) Fixes: 7eb99ddef7 (wayland/surface: Schedule updates in the context of the surface actor) Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3323 Part-of: --- src/compositor/meta-surface-actor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c index 8ffc2cd8a..db7b5bf1a 100644 --- a/src/compositor/meta-surface-actor.c +++ b/src/compositor/meta-surface-actor.c @@ -405,8 +405,11 @@ meta_surface_actor_get_texture (MetaSurfaceActor *self) void meta_surface_actor_schedule_update (MetaSurfaceActor *self) { - ClutterStage *stage = - CLUTTER_STAGE (clutter_actor_get_stage (CLUTTER_ACTOR (self))); + ClutterStage *stage; + + stage = CLUTTER_STAGE (clutter_actor_get_stage (CLUTTER_ACTOR (self))); + if (!stage) + return; clutter_stage_schedule_update (stage);