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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3633>
This commit is contained in:
Robert Mader 2024-03-02 22:33:13 +01:00 committed by Marge Bot
parent d5032449bb
commit e8b43d3b1b

View File

@ -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);