[gtk/wip/matthiasc/popup5: 94/124] widget: Optimize resize propagation



commit 9adff7fe5175425061a17d4aa5530cc9c8b1a93b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 4 18:12:45 2019 +0000

    widget: Optimize resize propagation
    
    When a GtkNative widget is marked as resize_needed,
    we need a current position for its parent and we need
    the parent to be allocated (so we can position our
    surface), but we don't need the parent to be marked
    as resize_needed, since the parent size is entirely
    independent of the popup size.

 gtk/gtkwidget.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ecc25d023c..c49b201fd0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4088,7 +4088,12 @@ gtk_widget_queue_resize_internal (GtkWidget *widget)
     {
       GtkWidget *parent = _gtk_widget_get_parent (widget);
       if (parent)
-        gtk_widget_queue_resize_internal (parent);
+        {
+          if (GTK_IS_NATIVE (widget))
+            gtk_widget_queue_allocate (parent);
+          else
+            gtk_widget_queue_resize_internal (parent);
+        }
     }
 }
 


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