[gtk+] button: Compute clip directly



commit b97b8b6ec186b0d666bf55f53344a284f5419619
Author: Timm Bäder <mail baedert org>
Date:   Thu Apr 27 07:40:14 2017 +0200

    button: Compute clip directly

 gtk/gtkbutton.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index df8e455..6066090 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -872,9 +872,17 @@ gtk_button_allocate (GtkCssGadget        *gadget,
 
   widget = gtk_css_gadget_get_owner (gadget);
 
+  *out_clip = *allocation;
+
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child && gtk_widget_get_visible (child))
-    gtk_widget_size_allocate_with_baseline (child, (GtkAllocation *)allocation, baseline);
+    {
+      GtkAllocation clip;
+
+      gtk_widget_size_allocate_with_baseline (child, (GtkAllocation *)allocation, baseline);
+      gtk_widget_get_clip (child, &clip);
+      gdk_rectangle_union (&clip, out_clip, out_clip);
+    }
 
   if (gtk_widget_get_realized (widget))
     {
@@ -886,8 +894,6 @@ gtk_button_allocate (GtkCssGadget        *gadget,
                               border_allocation.width,
                               border_allocation.height);
     }
-
-  gtk_container_get_children_clip (GTK_CONTAINER (widget), out_clip);
 }
 
 static void


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