[gtk/wip/chergert/quartz4u: 92/146] macos: more root coordinate fixes



commit f7aa91d0755f21cf1ac25d7464484529504aa85c
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 19 17:37:12 2020 -0700

    macos: more root coordinate fixes

 gdk/macos/GdkMacosWindow.c            | 4 ++--
 gdk/macos/gdkmacosdisplay-translate.c | 4 ++--
 gdk/macos/gdkmacosdisplay.c           | 4 ++--
 gdk/macos/gdkmacospopupsurface.c      | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c
index c9dae2364f..cd32254874 100644
--- a/gdk/macos/GdkMacosWindow.c
+++ b/gdk/macos/GdkMacosWindow.c
@@ -425,8 +425,8 @@
                                           &point.x,
                                           &point.y);
 
-  area.x = GDK_SURFACE (gdk_surface)->x;
-  area.y = GDK_SURFACE (gdk_surface)->y;
+  area.x = gdk_surface->root_x;
+  area.y = gdk_surface->root_y;
   area.width = GDK_SURFACE (gdk_surface)->width;
   area.height = GDK_SURFACE (gdk_surface)->height;
 
diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c
index aa73e304cc..628ec5df5a 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -758,8 +758,8 @@ find_surface_under_pointer (GdkMacosDisplay *self,
                                               screen_point.x,
                                               screen_point.y,
                                               &x_tmp, &y_tmp);
-      *x = x_tmp - surface->x;
-      *y = y_tmp - surface->y;
+      *x = x_tmp - GDK_MACOS_SURFACE (surface)->root_x;
+      *y = y_tmp - GDK_MACOS_SURFACE (surface)->root_y;
       /* If the coordinates are out of window bounds, this surface is not
        * under the pointer and we thus return NULL. This can occur when
        * surface under pointer has not yet been updated due to a very recent
diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c
index ed54f84e91..0f13304087 100644
--- a/gdk/macos/gdkmacosdisplay.c
+++ b/gdk/macos/gdkmacosdisplay.c
@@ -848,8 +848,8 @@ _gdk_macos_display_get_surface_at_coords (GdkMacosDisplay *self,
 
       if (x >= GDK_MACOS_SURFACE (surface)->root_x &&
           y >= GDK_MACOS_SURFACE (surface)->root_y &&
-          x <= (surface->x + surface->width) &&
-          y <= (surface->y + surface->height))
+          x <= (GDK_MACOS_SURFACE (surface)->root_x + surface->width) &&
+          y <= (GDK_MACOS_SURFACE (surface)->root_y + surface->height))
         {
           *surface_x = x - GDK_MACOS_SURFACE (surface)->root_x;
           *surface_y = y - GDK_MACOS_SURFACE (surface)->root_y;
diff --git a/gdk/macos/gdkmacospopupsurface.c b/gdk/macos/gdkmacospopupsurface.c
index 632f71eca6..5a42e87f67 100644
--- a/gdk/macos/gdkmacospopupsurface.c
+++ b/gdk/macos/gdkmacospopupsurface.c
@@ -69,8 +69,8 @@ gdk_macos_popup_surface_layout (GdkMacosPopupSurface *self,
                                     y,
                                     final_rect.width,
                                     final_rect.height);
-  else if (x != GDK_SURFACE (self)->x ||
-           y != GDK_SURFACE (self)->y)
+  else if (x != GDK_MACOS_SURFACE (self)->root_x ||
+           y != GDK_MACOS_SURFACE (self)->root_y)
     _gdk_macos_surface_move (GDK_MACOS_SURFACE (self), x, y);
   else
     return;


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