window: Fix get_surface_transform()
authorTimm Bäder <mail@baedert.org>
Wed, 20 May 2020 07:27:37 +0000 (09:27 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 20 May 2020 15:06:54 +0000 (17:06 +0200)
Look at the shadow here.

gtk/gtkwindow.c

index 743210560de7a6ae25a9a88ee1ca212227b7be88..98ae78899015840d29f10fd82f30ef419f9c2a7f 100644 (file)
@@ -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