From b01b5267bbbac4f041d2f3c08f5ce8b3c7caab82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 25 Apr 2017 08:11:51 +0200 Subject: [PATCH] frame: Compute clip directly --- gtk/gtkframe.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index 0a5ae21d81..1011d00540 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