widget: Only print allocation warnings with --enable-debug
authorTimm Bäder <mail@baedert.org>
Sat, 17 Mar 2018 12:14:25 +0000 (13:14 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 17 Mar 2018 12:15:33 +0000 (13:15 +0100)
i.e. if G_ENABLE_CONSISTENCY_CHECKS is defined. This makes sense,
considering that this warning is about consistency of internal widget
state.

gtk/gtkwidget.c

index 13421eab6950660c2cd5d65c1fbe946a196e2a3c..c910e43f7b5e275a37e7a36f66e455ccc942971b 100644 (file)
@@ -5981,12 +5981,14 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
       gtk_widget_queue_draw (widget);
     }
 
+#ifdef G_ENABLE_CONSISTENCY_CHECKS
   if (gtk_widget_get_resize_needed (widget))
     {
       g_warning ("Allocating size to %s %p without calling gtk_widget_get_preferred_width/height(). "
                  "How does the code know the size to allocate?",
                  gtk_widget_get_name (widget), widget);
     }
+#endif
 
   if (GTK_DEBUG_CHECK (GEOMETRY))
     {