From 8f4d61e663770d6a24b75d77418a145eba7c104f Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 20 Sep 2010 12:04:51 +0100 Subject: [PATCH] clutter-box-layout: Swap the default request mode The request mode set by the box layout was previously width-for-height in a vertical layout and height-for-width in a horizontal layout which seems to be wrong. For example, if width-for-height is used in a vertical layout then the width request will come second with the for_height parameter set. However a vertical layout doesn't pass the for_height parameter on to its children so doing the requests in that order doesn't help. If the layout contains a ClutterText then both the width and height request for it will have -1 for the for_width and for_height parameters so the text would end up allocated too small. http://bugzilla.clutter-project.org/show_bug.cgi?id=2328 --- clutter/clutter-box-layout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clutter/clutter-box-layout.c b/clutter/clutter-box-layout.c index f07dd4fbc..a9d946e78 100644 --- a/clutter/clutter-box-layout.c +++ b/clutter/clutter-box-layout.c @@ -477,9 +477,9 @@ clutter_box_layout_set_container (ClutterLayoutManager *layout, /* we need to change the :request-mode of the container * to match the orientation */ - request_mode = (priv->is_vertical) - ? CLUTTER_REQUEST_WIDTH_FOR_HEIGHT - : CLUTTER_REQUEST_HEIGHT_FOR_WIDTH; + request_mode = (priv->is_vertical + ? CLUTTER_REQUEST_HEIGHT_FOR_WIDTH + : CLUTTER_REQUEST_WIDTH_FOR_HEIGHT); clutter_actor_set_request_mode (CLUTTER_ACTOR (priv->container), request_mode); }