[gtk+] stack: Redraw last_visible_surface if child allocation changes



commit 8dce94c47a9957b47bda28243505ef3f13a509be
Author: Timm Bäder <mail baedert org>
Date:   Fri Oct 28 12:51:03 2016 +0200

    stack: Redraw last_visible_surface if child allocation changes
    
    So the widget is properly aligned.

 gtk/gtkstack.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 7b4af97..fd23f8a 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2239,6 +2239,13 @@ gtk_stack_allocate (GtkCssGadget        *gadget,
       child_allocation.height = MAX (min, allocation->height);
 
       gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
+
+      if (!gdk_rectangle_equal (&priv->last_visible_surface_allocation,
+                                &child_allocation))
+        {
+          cairo_surface_destroy (priv->last_visible_surface);
+          priv->last_visible_surface = NULL;
+        }
     }
 
   child_allocation.width = allocation->width;


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