widget: Only do a IS_ROOT type check if the parent is unset

So we do less type checks
This commit is contained in:
Timm Bäder 2020-04-26 17:34:32 +02:00
parent de40b0b061
commit ef623aaabc

View File

@ -10440,7 +10440,7 @@ gtk_widget_set_alloc_needed (GtkWidget *widget)
if (!priv->visible)
break;
if (GTK_IS_ROOT (widget))
if (!priv->parent && GTK_IS_ROOT (widget))
{
gtk_root_start_layout (GTK_ROOT (widget));
break;