widget: Re-shuffle preconditions in snapshot_child()

The GtkNative type check is more expensive than the mapped one, so avoid
the former for unmapped widgets
This commit is contained in:
Timm Bäder 2020-06-06 12:22:46 +02:00
parent 461497e8d4
commit 203bb42cc1

View File

@ -12045,10 +12045,10 @@ gtk_widget_snapshot_child (GtkWidget *widget,
g_return_if_fail (_gtk_widget_get_parent (child) == widget); g_return_if_fail (_gtk_widget_get_parent (child) == widget);
g_return_if_fail (snapshot != NULL); g_return_if_fail (snapshot != NULL);
if (GTK_IS_NATIVE (child)) if (!_gtk_widget_get_mapped (child))
return; return;
if (!_gtk_widget_get_mapped (child)) if (GTK_IS_NATIVE (child))
return; return;
gtk_widget_do_snapshot (child, snapshot); gtk_widget_do_snapshot (child, snapshot);