[libhandy/wip/exalm/css: 9/13] header-bar: Account for box-shadow when clipping



commit bfc7e6f60845f8afd85c1f02ef22bb5fb627dbff
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Thu May 21 00:23:15 2020 +0500

    header-bar: Account for box-shadow when clipping
    
    Fixes https://source.puri.sm/Librem5/libhandy/-/issues/274

 src/hdy-header-bar.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/hdy-header-bar.c b/src/hdy-header-bar.c
index aceedda3..b8f60768 100644
--- a/src/hdy-header-bar.c
+++ b/src/hdy-header-bar.c
@@ -1431,6 +1431,7 @@ hdy_header_bar_size_allocate (GtkWidget     *widget,
   HdyHeaderBarPrivate *priv = hdy_header_bar_get_instance_private (self);
   GtkAllocation *allocations;
   GtkAllocation title_allocation;
+  GtkAllocation clip;
   gint nvis_children;
   GList *l;
   gint i;
@@ -1443,6 +1444,13 @@ hdy_header_bar_size_allocate (GtkWidget     *widget,
   GtkWidget *decoration_box[2] = { priv->titlebar_start_box, priv->titlebar_end_box };
   gint decoration_width[2] = { 0 };
 
+  gtk_render_background_get_clip (gtk_widget_get_style_context (widget),
+                                  allocation->x,
+                                  allocation->y,
+                                  allocation->width,
+                                  allocation->height,
+                                  &clip);
+
   gtk_widget_set_allocation (widget, allocation);
 
   if (gtk_widget_get_realized (widget))
@@ -1557,6 +1565,8 @@ hdy_header_bar_size_allocate (GtkWidget     *widget,
     gtk_widget_size_allocate (priv->custom_title, &title_allocation);
   else if (priv->label_box != NULL)
     gtk_widget_size_allocate (priv->label_box, &title_allocation);
+
+  gtk_widget_set_clip (widget, &clip);
 }
 
 static void


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