mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 06:51:10 +00:00
widget: Make gtk_widget_real_realize() stricter
But in turn, also allow it to work on widgets with their own surface. This way, we can chain up from everywhere and won't have to export gtk_widget_set_realized().
This commit is contained in:
parent
0af5316f00
commit
5c51a302a4
@ -8755,14 +8755,18 @@ gtk_widget_real_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkWidgetPrivate *priv = widget->priv;
|
||||
|
||||
g_assert (!_gtk_widget_get_has_surface (widget));
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
if (priv->parent)
|
||||
if (_gtk_widget_get_has_surface (widget))
|
||||
{
|
||||
g_assert (priv->surface != NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_assert (priv->parent);
|
||||
priv->surface = gtk_widget_get_parent_surface (widget);
|
||||
g_object_ref (priv->surface);
|
||||
}
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
}
|
||||
|
||||
/*****************************************
|
||||
|
Loading…
Reference in New Issue
Block a user