[gtk/wip/chergert/quartz4u: 60/65] macos: add helper when surface is raised



commit 77dc16fb0ba2c71ce4c7c5c6fced3b4385e01893
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 13 16:52:37 2020 -0700

    macos: add helper when surface is raised

 gdk/macos/gdkmacosdisplay-private.h |  2 ++
 gdk/macos/gdkmacosdisplay.c         | 13 +++++++++++++
 2 files changed, 15 insertions(+)
---
diff --git a/gdk/macos/gdkmacosdisplay-private.h b/gdk/macos/gdkmacosdisplay-private.h
index 5d8bb9bc3c..b94d0e4021 100644
--- a/gdk/macos/gdkmacosdisplay-private.h
+++ b/gdk/macos/gdkmacosdisplay-private.h
@@ -131,6 +131,8 @@ void             _gdk_macos_display_surface_resigned_key           (GdkMacosDisp
                                                                     GdkMacosSurface *surface);
 void             _gdk_macos_display_surface_became_key             (GdkMacosDisplay *self,
                                                                     GdkMacosSurface *surface);
+void             _gdk_macos_display_surface_raised                 (GdkMacosDisplay *self,
+                                                                    GdkMacosSurface *surface);
 
 G_END_DECLS
 
diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c
index b5affc7df1..18fa02c582 100644
--- a/gdk/macos/gdkmacosdisplay.c
+++ b/gdk/macos/gdkmacosdisplay.c
@@ -946,6 +946,7 @@ _gdk_macos_display_find_native_under_pointer (GdkMacosDisplay *self,
   g_assert (GDK_IS_MACOS_DISPLAY (self));
 
   point = [NSEvent mouseLocation];
+
   surface = _gdk_macos_display_get_surface_at_display_coords (self, point.x, point.y, x, y);
   if (surface != NULL)
     return _gdk_macos_surface_get_native (surface);
@@ -953,3 +954,15 @@ _gdk_macos_display_find_native_under_pointer (GdkMacosDisplay *self,
   return NULL;
 }
 
+void
+_gdk_macos_display_surface_raised (GdkMacosDisplay *self,
+                                   GdkMacosSurface *surface)
+{
+  g_return_if_fail (GDK_IS_MACOS_DISPLAY (self));
+  g_return_if_fail (GDK_IS_MACOS_SURFACE (surface));
+
+  if (queue_contains (&self->sorted_surfaces, &surface->sorted))
+    g_queue_unlink (&self->sorted_surfaces, &surface->sorted);
+
+  g_queue_push_head_link (&self->sorted_surfaces, &surface->sorted);
+}


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