[gtk/wip/matthiasc/popup4: 11/110] css: Use the new idle sizer



commit 17c74241992bf7f41237d1a81746a42d1417eb90
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Mar 17 00:37:01 2019 -0400

    css: Use the new idle sizer

 gtk/gtkcsswidgetnode.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkcsswidgetnode.c b/gtk/gtkcsswidgetnode.c
index 3b1440d169..4329a0c1ac 100644
--- a/gtk/gtkcsswidgetnode.c
+++ b/gtk/gtkcsswidgetnode.c
@@ -19,7 +19,7 @@
 
 #include "gtkcsswidgetnodeprivate.h"
 
-#include "gtkcontainerprivate.h"
+#include "gtkrootprivate.h"
 #include "gtkcssanimatedstyleprivate.h"
 #include "gtkprivate.h"
 #include "gtksettingsprivate.h"
@@ -60,7 +60,7 @@ gtk_css_widget_node_queue_callback (GtkWidget     *widget,
   GtkCssNode *node = user_data;
 
   gtk_css_node_invalidate_frame_clock (node, TRUE);
-  _gtk_container_queue_restyle (GTK_CONTAINER (widget));
+  gtk_root_queue_restyle (GTK_ROOT (widget));
 
   return G_SOURCE_CONTINUE;
 }
@@ -70,8 +70,7 @@ gtk_css_widget_node_queue_validate (GtkCssNode *node)
 {
   GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
 
-  if (widget_node->widget && _gtk_widget_is_toplevel (widget_node->widget) &&
-      GTK_IS_CONTAINER (widget_node->widget))
+  if (widget_node->widget && GTK_IS_ROOT (widget_node->widget))
     widget_node->validate_cb_id = gtk_widget_add_tick_callback (widget_node->widget,
                                                                 gtk_css_widget_node_queue_callback,
                                                                 node,
@@ -83,10 +82,12 @@ gtk_css_widget_node_dequeue_validate (GtkCssNode *node)
 {
   GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
 
-  if (widget_node->widget && _gtk_widget_is_toplevel (widget_node->widget) &&
-      GTK_IS_CONTAINER (widget_node->widget))
-    gtk_widget_remove_tick_callback (widget_node->widget,
-                                     widget_node->validate_cb_id);
+  if (widget_node->validate_cb_id)
+    {
+      gtk_widget_remove_tick_callback (widget_node->widget,
+                                       widget_node->validate_cb_id);
+      widget_node->validate_cb_id = 0;
+    }
 }
 
 static void


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