[mutter/gnome-42] clutter/actor: Queue relayouts in more clone cases
- From: Robert Mader <rmader src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-42] clutter/actor: Queue relayouts in more clone cases
- Date: Fri, 29 Jul 2022 20:33:15 +0000 (UTC)
commit e382fbd2a1bb919e144741690fb72885a16e8314
Author: Robert Mader <robert mader posteo de>
Date: Mon Jul 25 21:45:07 2022 +0200
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>
(cherry picked from commit 8d04b9067d75dea5973adc94b6f4c049657d5dfd)
clutter/clutter/clutter-actor.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index f6c67ad237..a617310e02 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -1770,6 +1770,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
@@ -11706,6 +11718,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]