[gtk+/wip/otte/queue-resize: 22/32] widget: Warn on calls to queue_resize() during size_allocate()

commit a41184b74b229d22c09e210aecc88062f36fb186
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 28 05:42:04 2015 +0200

    widget: Warn on calls to queue_resize() during size_allocate()
    This happens way too much, so it's disabled unless GTK_DEBUG=geometry is
    Also, we can't detect it in the call to queue_resize() yet, only during
    size_allocate(), so the warning comes after the signal emission.

 gtk/gtkwidget.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b39a33c..126b485 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5988,6 +5988,13 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
     GTK_WIDGET_GET_CLASS (widget)->size_allocate (widget, &real_allocation);
   /* Size allocation is god... after consulting god, no further requests or allocations are needed */
+  if (GTK_DEBUG_CHECK (GEOMETRY) && gtk_widget_get_resize_needed (widget))
+    {
+      g_warning ("%s %p or a child called gtk_widget_queue_resize() during size_allocte().",
+                 gtk_widget_get_name (widget), widget);
+    }
   gtk_widget_ensure_resize (widget);
   priv->alloc_needed = FALSE;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]