[gtk/wip/chergert/quartz4u] macos: tweak window stacking level by kind



commit a7a7d94ce47c2cadf215cd372debdaced1295d0f
Author: Christian Hergert <chergert redhat com>
Date:   Sat May 9 17:12:29 2020 -0700

    macos: tweak window stacking level by kind

 gdk/macos/gdkmacospopupsurface.c    | 1 +
 gdk/macos/gdkmacostoplevelsurface.c | 4 ++++
 2 files changed, 5 insertions(+)
---
diff --git a/gdk/macos/gdkmacospopupsurface.c b/gdk/macos/gdkmacospopupsurface.c
index b845fadc92..073e2d36f6 100644
--- a/gdk/macos/gdkmacospopupsurface.c
+++ b/gdk/macos/gdkmacospopupsurface.c
@@ -287,6 +287,7 @@ _gdk_macos_popup_surface_new (GdkMacosDisplay *display,
 
   [window setOpaque:NO];
   [window setBackgroundColor:[NSColor clearColor]];
+  [window setLevel:NSPopUpMenuWindowLevel];
 
   self = g_object_new (GDK_TYPE_MACOS_POPUP_SURFACE,
                        "display", display,
diff --git a/gdk/macos/gdkmacostoplevelsurface.c b/gdk/macos/gdkmacostoplevelsurface.c
index 086296e1b5..9b5138c8d1 100644
--- a/gdk/macos/gdkmacostoplevelsurface.c
+++ b/gdk/macos/gdkmacostoplevelsurface.c
@@ -445,6 +445,9 @@ _gdk_macos_toplevel_surface_attach_to_parent (GdkMacosToplevelSurface *self)
       NSWindow *window = _gdk_macos_surface_get_native (GDK_MACOS_SURFACE (self));
 
       [parent addChildWindow:window ordered:NSWindowAbove];
+
+      if (_gdk_macos_surface_get_modal_hint (GDK_MACOS_SURFACE (self)))
+        [window setLevel:NSModalPanelWindowLevel];
     }
 }
 
@@ -465,5 +468,6 @@ _gdk_macos_toplevel_surface_detach_from_parent (GdkMacosToplevelSurface *self)
       NSWindow *window = _gdk_macos_surface_get_native (GDK_MACOS_SURFACE (self));
 
       [parent removeChildWindow:window];
+      [window setLevel:NSNormalWindowLevel];
     }
 }


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