Disable underallocation warnings in non-debug builds

It doesn't look like we have much traction of actually fixing
these, and there is very real cost to not being able to distcheck.
This commit is contained in:
Matthias Clasen 2011-08-30 08:44:13 -04:00
parent 53602c400d
commit a233022934

View File

@ -4819,14 +4819,19 @@ gtk_widget_size_allocate (GtkWidget *widget,
gtk_widget_get_preferred_width_for_height (widget, real_allocation.height, &min_width, &natural_width); gtk_widget_get_preferred_width_for_height (widget, real_allocation.height, &min_width, &natural_width);
} }
if ((min_width > real_allocation.width || min_height > real_allocation.height) && #ifdef G_ENABLE_DEBUG
!GTK_IS_SCROLLABLE (widget)) if (gtk_get_debug_flags () & GTK_DEBUG_GEOMETRY)
g_warning ("gtk_widget_size_allocate(): attempt to underallocate %s%s %s %p. " {
"Allocation is %dx%d, but minimum required size is %dx%d.", if ((min_width > real_allocation.width || min_height > real_allocation.height) &&
priv->parent ? G_OBJECT_TYPE_NAME (priv->parent) : "", priv->parent ? "'s child" : "toplevel", !GTK_IS_SCROLLABLE (widget))
G_OBJECT_TYPE_NAME (widget), widget, g_warning ("gtk_widget_size_allocate(): attempt to underallocate %s%s %s %p. "
real_allocation.width, real_allocation.height, "Allocation is %dx%d, but minimum required size is %dx%d.",
min_width, min_height); priv->parent ? G_OBJECT_TYPE_NAME (priv->parent) : "", priv->parent ? "'s child" : "toplevel",
G_OBJECT_TYPE_NAME (widget), widget,
real_allocation.width, real_allocation.height,
min_width, min_height);
}
#endif
/* Now that we have the right natural height and width, go ahead and remove any margins from the /* Now that we have the right natural height and width, go ahead and remove any margins from the
* allocated sizes and possibly limit them to the natural sizes */ * allocated sizes and possibly limit them to the natural sizes */
GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget, GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget,