From ad50d2cfc4596d27645333f44bf57d68dbf696ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 18 Jun 2020 17:07:33 +0200 Subject: [PATCH] clutter/actor: Always query layout manager when getting size There are cases where a layout manager used by an actor also wants to return a custom size when the actor has no children, for example in case the layout manager requests a fixed size. This is currently impossible because we only query the layout manager when calculating the preferred size if the actor has children. So fix that and also use the layout managers size negotiation functions in case the actor has no children. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1322 --- clutter/clutter/clutter-actor.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 7f6ef007b..01a238274 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -2443,8 +2443,7 @@ clutter_actor_real_get_preferred_width (ClutterActor *self, { ClutterActorPrivate *priv = self->priv; - if (priv->n_children != 0 && - priv->layout_manager != NULL) + if (priv->layout_manager != NULL) { ClutterContainer *container = CLUTTER_CONTAINER (self); @@ -2483,8 +2482,7 @@ clutter_actor_real_get_preferred_height (ClutterActor *self, { ClutterActorPrivate *priv = self->priv; - if (priv->n_children != 0 && - priv->layout_manager != NULL) + if (priv->layout_manager != NULL) { ClutterContainer *container = CLUTTER_CONTAINER (self);