[gtk+] frame: Compute clip directly



commit b01b5267bbbac4f041d2f3c08f5ce8b3c7caab82
Author: Timm Bäder <mail baedert org>
Date:   Tue Apr 25 08:11:51 2017 +0200

    frame: Compute clip directly

 gtk/gtkframe.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 0a5ae21..1011d00 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -688,7 +688,7 @@ static void
 gtk_frame_size_allocate (GtkWidget     *widget,
                         GtkAllocation *allocation)
 {
-  GtkAllocation clip;
+  GtkAllocation clip = *allocation;
 
   gtk_widget_set_allocation (widget, allocation);
 
@@ -712,6 +712,7 @@ gtk_frame_allocate (GtkCssGadget        *gadget,
   GtkFramePrivate *priv;
   GtkWidget *child;
   GtkAllocation new_allocation;
+  GtkAllocation clip;
 
   widget = gtk_css_gadget_get_owner (gadget);
   frame = GTK_FRAME (widget);
@@ -743,13 +744,17 @@ gtk_frame_allocate (GtkCssGadget        *gadget,
       priv->label_allocation.width = width;
 
       gtk_widget_size_allocate (priv->label_widget, &priv->label_allocation);
+      gtk_widget_get_clip (priv->label_widget, &clip);
+      gdk_rectangle_union (out_clip, out_clip, &clip);
     }
 
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child && gtk_widget_get_visible (child))
-    gtk_widget_size_allocate (child, &priv->child_allocation);
-
-  gtk_container_get_children_clip (GTK_CONTAINER (widget), out_clip);
+    {
+      gtk_widget_size_allocate (child, &priv->child_allocation);
+      gtk_widget_get_clip (child, &clip);
+      gdk_rectangle_union (out_clip, out_clip, &clip);
+    }
 }
 
 static void


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