From 1c1c8b25edf79574bd41e1517b4261d2a91fc7eb Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 29 Jun 2020 15:15:46 +0200 Subject: [PATCH] window-actor: Freeze subsurfaces as well In order to prevent glitches in animations, make sure we freeze all surfaces of a window actor. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1339 --- src/compositor/meta-surface-actor.c | 3 +++ src/compositor/meta-window-actor.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c index 0fa6f64ed..7d5f2bc5d 100644 --- a/src/compositor/meta-surface-actor.c +++ b/src/compositor/meta-surface-actor.c @@ -545,6 +545,9 @@ meta_surface_actor_set_frozen (MetaSurfaceActor *self, MetaSurfaceActorPrivate *priv = meta_surface_actor_get_instance_private (self); + if (priv->frozen == frozen) + return; + priv->frozen = frozen; if (!frozen && priv->pending_damage) diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index 3b39ce9dd..523fff8fb 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -261,13 +261,15 @@ static void meta_window_actor_set_frozen (MetaWindowActor *self, gboolean frozen) { - MetaWindowActorPrivate *priv = - meta_window_actor_get_instance_private (self); + ClutterActor *child; + ClutterActorIter iter; - if (meta_surface_actor_is_frozen (priv->surface) == frozen) - return; - - meta_surface_actor_set_frozen (priv->surface, frozen); + clutter_actor_iter_init (&iter, CLUTTER_ACTOR (self)); + while (clutter_actor_iter_next (&iter, &child)) + { + if (META_IS_SURFACE_ACTOR (child)) + meta_surface_actor_set_frozen (META_SURFACE_ACTOR (child), frozen); + } META_WINDOW_ACTOR_GET_CLASS (self)->set_frozen (self, frozen); }