1
0
Fork 0

clutter/actor: Queue relayouts in more clone cases

In certain edge cases it's currently possible that an actor never
gets a valid allocation and paint volume.

One such case is adding an unmapped, hidden child to an unmapped
cloned parent and then showing the child. This happens currently
 e.g. if a Wayland subsurface is added to a already mapped window
while the user is in the overview.

Ensure relayouts in two more such cases.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2530>
This commit is contained in:
Robert Mader 2022-07-25 21:45:07 +02:00 committed by Marge Bot
parent e7a64db51a
commit 8d04b9067d

View file

@ -1777,6 +1777,18 @@ clutter_actor_real_show (ClutterActor *self)
* and the branch of the scene graph is in a stable state
*/
clutter_actor_update_map_state (self, MAP_STATE_CHECK);
if (clutter_actor_has_mapped_clones (self))
{
ClutterActorPrivate *priv = self->priv;
/* Avoid the early return in clutter_actor_queue_relayout() */
priv->needs_width_request = FALSE;
priv->needs_height_request = FALSE;
priv->needs_allocation = FALSE;
clutter_actor_queue_relayout (self);
}
}
static inline void
@ -11699,6 +11711,18 @@ clutter_actor_add_child_internal (ClutterActor *self,
if (CLUTTER_ACTOR_IS_MAPPED (child))
clutter_actor_queue_redraw (child);
if (clutter_actor_has_mapped_clones (self))
{
ClutterActorPrivate *priv = self->priv;
/* Avoid the early return in clutter_actor_queue_relayout() */
priv->needs_width_request = FALSE;
priv->needs_height_request = FALSE;
priv->needs_allocation = FALSE;
clutter_actor_queue_relayout (self);
}
if (emit_actor_added)
_clutter_container_emit_actor_added (CLUTTER_CONTAINER (self), child);