diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 79a92196a..d711f0607 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -9725,6 +9725,23 @@ clutter_actor_get_preferred_width (ClutterActor *self, return; } + /* if the request mode is CONTENT_SIZE we simply return the content width */ + if (priv->request_mode == CLUTTER_REQUEST_CONTENT_SIZE) + { + float content_width = 0.f; + + if (priv->content != NULL) + clutter_content_get_preferred_size (priv->content, &content_width, NULL); + + if (min_width_p != NULL) + *min_width_p = content_width; + + if (natural_width_p != NULL) + *natural_width_p = content_width; + + return; + } + CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_WIDTH); /* the remaining cases are: @@ -9873,6 +9890,23 @@ clutter_actor_get_preferred_height (ClutterActor *self, return; } + /* if the request mode is CONTENT_SIZE we simply return the content height */ + if (priv->request_mode == CLUTTER_REQUEST_CONTENT_SIZE) + { + float content_height = 0.f; + + if (priv->content != NULL) + clutter_content_get_preferred_size (priv->content, NULL, &content_height); + + if (min_height_p != NULL) + *min_height_p = content_height; + + if (natural_height_p != NULL) + *natural_height_p = content_height; + + return; + } + CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_HEIGHT); /* the remaining cases are: