mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-04 09:40:19 +00:00
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:
parent
5e07a31d2b
commit
b0a5e8764c
@ -8168,6 +8168,7 @@ gtk_widget_set_has_window (GtkWidget *widget,
|
|||||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||||
|
|
||||||
widget->priv->no_window = !has_window;
|
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_set_qdata (object, quark_widget_path, NULL);
|
||||||
|
|
||||||
G_OBJECT_CLASS (gtk_widget_parent_class)->constructed (object);
|
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
|
static void
|
||||||
|
@ -53,6 +53,7 @@ struct _GtkWidgetPrivate
|
|||||||
guint toplevel : 1;
|
guint toplevel : 1;
|
||||||
guint anchored : 1;
|
guint anchored : 1;
|
||||||
guint no_window : 1;
|
guint no_window : 1;
|
||||||
|
guint no_window_set : 1;
|
||||||
guint realized : 1;
|
guint realized : 1;
|
||||||
guint mapped : 1;
|
guint mapped : 1;
|
||||||
guint visible : 1;
|
guint visible : 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user