[gtk/matthiasc/css-change-tracking] Add a define



commit d5ec71541d09800f541f5bad3a9137452b8c72b7
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 16 13:15:54 2020 -0500

    Add a define
    
    Add a define for the changes that require
    recomputing change flags, and put it next
    to the definition of radical change.

 gtk/gtkcssnode.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 58189c069b..01fd3f8dfa 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -87,6 +87,11 @@
  * if we need to change things. */
 #define GTK_CSS_RADICAL_CHANGE (GTK_CSS_CHANGE_ID | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_CLASS | 
GTK_CSS_CHANGE_SOURCE | GTK_CSS_CHANGE_PARENT_STYLE)
 
+/* When these change, we need to recompute the change flags for the new style
+ * since they may have changed.
+ */
+#define GTK_CSS_CHANGE_CHANGE (GTK_CSS_CHANGE_ID | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_CLASS | 
GTK_CSS_CHANGE_SOURCE)
+
 G_DEFINE_TYPE (GtkCssNode, gtk_css_node, G_TYPE_OBJECT)
 
 enum {
@@ -365,7 +370,7 @@ gtk_css_node_create_style (GtkCssNode   *cssnode,
 
   parent = cssnode->parent ? cssnode->parent->style : NULL;
 
-  if (change & (GTK_CSS_CHANGE_ID | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_SOURCE))
+  if (change & GTK_CSS_CHANGE_CHANGE)
     {
       /* Need to recompute the change flags */
       change_flags = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]