[gtk/wip/baedert/for-master: 15/27] widget: Re-shuffle preconditions in snapshot_child()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 15/27] widget: Re-shuffle preconditions in snapshot_child()
- Date: Fri, 12 Jun 2020 03:51:06 +0000 (UTC)
commit 70e4c1601e0361db386f79e264d113ef48a458ca
Author: Timm Bäder <mail baedert org>
Date: Sat Jun 6 12:22:46 2020 +0200
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
gtk/gtkwidget.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 4bc674b8b9..3353c72afe 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12045,10 +12045,10 @@ gtk_widget_snapshot_child (GtkWidget *widget,
g_return_if_fail (_gtk_widget_get_parent (child) == widget);
g_return_if_fail (snapshot != NULL);
- if (GTK_IS_NATIVE (child))
+ if (!_gtk_widget_get_mapped (child))
return;
- if (!_gtk_widget_get_mapped (child))
+ if (GTK_IS_NATIVE (child))
return;
gtk_widget_do_snapshot (child, snapshot);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]