Make GtkWindow use the generic smallest size for the requisition again

This commit is contained in:
Tristan Van Berkom 2010-04-17 22:51:35 -04:00
parent 19ff8cb026
commit b30445c927

View File

@ -4949,18 +4949,17 @@ gtk_window_size_request (GtkWidget *widget,
if (bin->child && gtk_widget_get_visible (bin->child)) if (bin->child && gtk_widget_get_visible (bin->child))
{ {
gint width, height; /* Use the minimum width for the natural height; even if its an hbox.
/* XXX Use the minimum width for the natural height; even if its an hbox.
* *
* This doesnt need to be here; naturally it will use the preference of the child * This doesnt need to be here; naturally it will use the preference of the child
* except for testing purposes its more interesting this way. * except for testing purposes its more interesting this way.
*/ */
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child), NULL, &height); GtkRequisition child_req;
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (bin->child), height, &width, NULL);
requisition->width += width; gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (bin->child), &child_req, NULL);
requisition->height += height;
requisition->width += child_req.width;
requisition->height += child_req.height;
} }
} }