Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'

macos: fix window stacking

See merge request GNOME/gtk!2907
This commit is contained in:
Matthias Clasen 2020-12-02 18:38:14 +00:00
commit 3da41b6021
2 changed files with 9 additions and 1 deletions

View File

@ -505,6 +505,7 @@ _gdk_macos_surface_new (GdkMacosDisplay *display,
{
GdkFrameClock *frame_clock;
GdkMacosSurface *ret;
NSInteger window_level = NSNormalWindowLevel;
g_return_val_if_fail (GDK_IS_MACOS_DISPLAY (display), NULL);
@ -521,10 +522,12 @@ _gdk_macos_surface_new (GdkMacosDisplay *display,
case GDK_SURFACE_POPUP:
ret = _gdk_macos_popup_surface_new (display, parent, frame_clock, x, y, width, height);
window_level = NSPopUpMenuWindowLevel;
break;
case GDK_SURFACE_TEMP:
ret = _gdk_macos_drag_surface_new (display, frame_clock, x, y, width, height);
window_level = NSPopUpMenuWindowLevel;
break;
default:
@ -533,7 +536,10 @@ _gdk_macos_surface_new (GdkMacosDisplay *display,
}
if (ret != NULL)
_gdk_macos_surface_monitor_changed (ret);
{
[ret->window setLevel:window_level];
_gdk_macos_surface_monitor_changed (ret);
}
g_object_unref (frame_clock);

View File

@ -100,6 +100,8 @@ _gdk_macos_toplevel_surface_present (GdkToplevel *toplevel,
g_assert (GDK_IS_MACOS_TOPLEVEL_SURFACE (self));
g_assert (GDK_IS_MACOS_WINDOW (nswindow));
_gdk_macos_toplevel_surface_attach_to_parent (self);
style_mask = [nswindow styleMask];
monitor = gdk_display_get_monitor_at_surface (display, surface);