summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-10-28 12:51:03 +0200
committerTimm Bäder <mail@baedert.org>2016-10-31 19:29:36 +0100
commit8dce94c47a9957b47bda28243505ef3f13a509be (patch)
tree6d178373d97e74a6eaea6360e8f7eea5958ae805
parent212f8a6c7be8795eb0d130cc1f02e770dc17fa1d (diff)
downloadgtk+-8dce94c47a9957b47bda28243505ef3f13a509be.tar.gz
stack: Redraw last_visible_surface if child allocation changes
So the widget is properly aligned.
-rw-r--r--gtk/gtkstack.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 7b4af97914..fd23f8a403 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;