gint nat_size = 0;
gboolean found_in_cache;
+ if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_CONSTANT_SIZE)
+ for_size = -1;
+
cache = _gtk_widget_peek_request_cache (widget);
found_in_cache = _gtk_size_request_cache_lookup (cache,
orientation,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- if (for_size < 0 || gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_CONSTANT_SIZE)
+ if (for_size < 0)
{
push_recursion_check (widget, orientation, for_size);
GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget, &min_size, &nat_size);
}
else
{
- if (for_size < 0 || gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_CONSTANT_SIZE)
+ if (for_size < 0)
{
push_recursion_check (widget, orientation, for_size);
GTK_WIDGET_GET_CLASS (widget)->get_preferred_height (widget, &min_size, &nat_size);
gpointer key;
gint min_result = 0, nat_result = 0;
+ if (!gtk_widget_get_visible (widget) && !gtk_widget_is_toplevel (widget))
+ {
+ if (minimum)
+ *minimum = 0;
+ if (natural)
+ *natural = 0;
+ return;
+ }
+
if (G_LIKELY (!_gtk_widget_get_sizegroups (widget)))
{
gtk_widget_query_size_for_orientation (widget, orientation, for_size, minimum, natural);