[gtk+] Add a warning for a broken situation



commit f168de3ada3a074df7184010ff43714fc8864dbe
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 30 16:14:36 2016 -0400

    Add a warning for a broken situation
    
    When we emit ::draw, the widget should not have alloc_needed set
    anymore. If this happens, it indicates a broken situation. Add a
    warning to help tracking down why this might occur.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=765410

 gtk/gtkwidget.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 5b0e280..af95148 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6973,6 +6973,9 @@ gtk_widget_draw_internal (GtkWidget *widget,
       if (push_group)
         cairo_push_group (cr);
 
+      if (_gtk_widget_get_alloc_needed (widget))
+        g_warning ("%s %p is drawn without a current allocation. This should not happen.", 
G_OBJECT_TYPE_NAME (widget), widget);
+
       if (g_signal_has_handler_pending (widget, widget_signals[DRAW], 0, FALSE))
         {
           g_signal_emit (widget, widget_signals[DRAW],


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