widget: Insist on widgets calling gtk_widget_set_has_window()

This way, we can grep the code for the bad widgets that set this to
TRUE and fix them.
This commit is contained in:
Benjamin Otte 2016-11-02 06:51:59 +01:00
parent 5e07a31d2b
commit b0a5e8764c
2 changed files with 7 additions and 0 deletions

View File

@ -8168,6 +8168,7 @@ gtk_widget_set_has_window (GtkWidget *widget,
g_return_if_fail (GTK_IS_WIDGET (widget));
widget->priv->no_window = !has_window;
widget->priv->no_window_set = TRUE;
}
/**
@ -10415,6 +10416,11 @@ gtk_widget_constructed (GObject *object)
g_object_set_qdata (object, quark_widget_path, NULL);
G_OBJECT_CLASS (gtk_widget_parent_class)->constructed (object);
if (!widget->priv->no_window_set)
{
g_warning ("%s does not call gtk_widget_set_has_window() in its init function", G_OBJECT_TYPE_NAME (widget));
}
}
static void

View File

@ -53,6 +53,7 @@ struct _GtkWidgetPrivate
guint toplevel : 1;
guint anchored : 1;
guint no_window : 1;
guint no_window_set : 1;
guint realized : 1;
guint mapped : 1;
guint visible : 1;