From: Matthias Clasen Date: Fri, 28 Apr 2023 18:27:07 +0000 (-0400) Subject: scrolledwindow: Stop using gtk_widget_get_allocation X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~347^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=be62147dee9f2d624b8c2042b5939f239a250e61;p=gtk4.git scrolledwindow: Stop using gtk_widget_get_allocation --- diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index fed7c32eed..e3a7c347a1 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -1855,24 +1855,22 @@ gtk_scrolled_window_snapshot_scrollbars_junction (GtkScrolledWindow *scrolled_wi GtkSnapshot *snapshot) { GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window); - GtkAllocation hscr_allocation, vscr_allocation; + graphene_rect_t hscr_bounds, vscr_bounds; GtkCssStyle *style; - GdkRectangle junction_rect; GtkCssBoxes boxes; - gtk_widget_get_allocation (GTK_WIDGET (priv->hscrollbar), &hscr_allocation); - gtk_widget_get_allocation (GTK_WIDGET (priv->vscrollbar), &vscr_allocation); + if (!gtk_widget_compute_bounds (GTK_WIDGET (priv->hscrollbar), GTK_WIDGET (scrolled_window), &hscr_bounds)) + return; - junction_rect.x = vscr_allocation.x; - junction_rect.y = hscr_allocation.y; - junction_rect.width = vscr_allocation.width; - junction_rect.height = hscr_allocation.height; + if (!gtk_widget_compute_bounds (GTK_WIDGET (priv->vscrollbar), GTK_WIDGET (scrolled_window), &vscr_bounds)) + return; style = gtk_css_node_get_style (priv->junction_node); gtk_css_boxes_init_border_box (&boxes, style, - junction_rect.x, junction_rect.y, - junction_rect.width, junction_rect.height); + vscr_bounds.origin.x, hscr_bounds.origin.y, + vscr_bounds.size.width, hscr_bounds.size.height); + gtk_css_style_snapshot_background (&boxes, snapshot); gtk_css_style_snapshot_border (&boxes, snapshot); }