[gtk+/wip/baedert/drawing: 283/371] stack: Compute clip directly



commit 456cc4cc0a709b56e890387e6703b22c8f96ee22
Author: Timm Bäder <mail baedert org>
Date:   Sun Jun 25 19:00:30 2017 +0200

    stack: Compute clip directly

 gtk/gtkstack.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 7114b54..6855e67 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);
 }
 


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