[gtk+/wip/gbsneto/other-locations] cssnode: Only queue_validate() when node is visible
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/gbsneto/other-locations] cssnode: Only queue_validate() when node is visible
- Date: Sat, 11 Jul 2015 14:29:19 +0000 (UTC)
commit 2c99e6473efdfbddb73ceafabc7efd7731dd4d26
Author: Benjamin Otte <otte redhat com>
Date: Fri Jul 10 21:34:41 2015 +0200
cssnode: Only queue_validate() when node is visible
This avoids running animations in hidden toplevels.
gtk/gtkcssnode.c | 37 ++++++++++++++++++++++++++++---------
1 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 7bae9d5..0b88b91 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -67,17 +67,20 @@ gtk_css_node_set_invalid (GtkCssNode *node,
node->invalid = invalid;
- if (node->parent)
- {
- if (invalid && node->visible)
- gtk_css_node_set_invalid (node->parent, TRUE);
- }
- else
+ if (node->visible)
{
- if (invalid)
- GTK_CSS_NODE_GET_CLASS (node)->queue_validate (node);
+ if (node->parent)
+ {
+ if (invalid)
+ gtk_css_node_set_invalid (node->parent, TRUE);
+ }
else
- GTK_CSS_NODE_GET_CLASS (node)->dequeue_validate (node);
+ {
+ if (invalid)
+ GTK_CSS_NODE_GET_CLASS (node)->queue_validate (node);
+ else
+ GTK_CSS_NODE_GET_CLASS (node)->dequeue_validate (node);
+ }
}
}
@@ -896,6 +899,22 @@ gtk_css_node_set_visible (GtkCssNode *cssnode,
cssnode->visible = visible;
g_object_notify_by_pspec (G_OBJECT (cssnode), cssnode_properties[PROP_VISIBLE]);
+ if (cssnode->invalid)
+ {
+ if (cssnode->visible)
+ {
+ if (cssnode->parent)
+ gtk_css_node_set_invalid (cssnode->parent, TRUE);
+ else
+ GTK_CSS_NODE_GET_CLASS (cssnode)->queue_validate (cssnode);
+ }
+ else
+ {
+ if (cssnode->parent == NULL)
+ GTK_CSS_NODE_GET_CLASS (cssnode)->dequeue_validate (cssnode);
+ }
+ }
+
if (cssnode->next_sibling)
gtk_css_node_invalidate (cssnode->next_sibling, GTK_CSS_CHANGE_ANY_SIBLING
| GTK_CSS_CHANGE_NTH_CHILD
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]