From 8c884e94c28bc8e2bb34a1cc949b55aebb9df3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 20 May 2020 09:27:37 +0200 Subject: [PATCH] window: Fix get_surface_transform() Look at the shadow here. --- gtk/gtkwindow.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 743210560d..98ae788990 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1896,11 +1896,15 @@ gtk_window_native_get_surface_transform (GtkNative *native, double *y) { GtkBorder shadow; + GtkCssBoxes css_boxes; + const graphene_rect_t *margin_rect; get_shadow_width (GTK_WINDOW (native), &shadow); + gtk_css_boxes_init (&css_boxes, GTK_WIDGET (native)); + margin_rect = gtk_css_boxes_get_margin_rect (&css_boxes); - *x = shadow.left; - *y = shadow.right; + *x = shadow.left - margin_rect->origin.x; + *y = shadow.top - margin_rect->origin.y; } static void