From 27202ff6cb47d21201567631c6404a4ebe3a81b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 25 Jun 2017 19:00:30 +0200 Subject: [PATCH] stack: Compute clip directly --- gtk/gtkstack.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 7114b54199..6855e67e80 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -2029,6 +2029,7 @@ gtk_stack_size_allocate (GtkWidget *widget, GtkStack *stack = GTK_STACK (widget); GtkStackPrivate *priv = gtk_stack_get_instance_private (stack); GtkAllocation clip = *allocation; + GdkRectangle child_clip; GtkAllocation child_allocation; child_allocation.x = get_bin_window_x (stack); @@ -2048,6 +2049,9 @@ gtk_stack_size_allocate (GtkWidget *widget, child_allocation.height = MAX (min, allocation->height); gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation); + gtk_widget_get_clip (priv->last_visible_child->widget, &child_clip); + gdk_rectangle_union (&clip, &child_clip, &clip); + if (!gdk_rectangle_equal (&priv->last_visible_surface_allocation, &child_allocation)) @@ -2093,10 +2097,10 @@ gtk_stack_size_allocate (GtkWidget *widget, } gtk_widget_size_allocate (priv->visible_child->widget, &child_allocation); + gtk_widget_get_clip (priv->visible_child->widget, &child_clip); + gdk_rectangle_union (&clip, &child_clip, &clip); } - gtk_container_get_children_clip (GTK_CONTAINER (widget), &clip); - gtk_widget_set_clip (widget, &clip); }