Merge branch 'macos-surface-critical' into 'main'

gdkmacossurface: Set surface before accessing it

See merge request GNOME/gtk!7267
This commit is contained in:
Emmanuele Bassi 2024-05-22 09:10:35 +00:00
commit 840a20db3b
3 changed files with 6 additions and 6 deletions

View File

@ -96,12 +96,12 @@ _gdk_macos_drag_surface_constructed (GObject *object)
defer:NO
screen:screen];
_gdk_macos_surface_set_native (self, window);
[window setOpaque:NO];
[window setBackgroundColor:[NSColor clearColor]];
[window setDecorated:NO];
_gdk_macos_surface_set_native (self, window);
frame_clock = _gdk_frame_clock_idle_new ();
gdk_surface_set_frame_clock (surface, frame_clock);
g_object_unref (frame_clock);

View File

@ -306,14 +306,14 @@ _gdk_macos_popup_surface_constructed (GObject *object)
defer:NO
screen:screen];
_gdk_macos_surface_set_native (GDK_MACOS_SURFACE (self), window);
[window setOpaque:NO];
[window setBackgroundColor:[NSColor clearColor]];
[window setDecorated:NO];
[window setExcludedFromWindowsMenu:YES];
[window setLevel:NSPopUpMenuWindowLevel];
_gdk_macos_surface_set_native (GDK_MACOS_SURFACE (self), window);
gdk_surface_set_frame_clock (surface, gdk_surface_get_frame_clock (surface->parent));
GDK_END_MACOS_ALLOC_POOL;

View File

@ -591,11 +591,11 @@ _gdk_macos_toplevel_surface_constructed (GObject *object)
defer:NO
screen:screen];
_gdk_macos_surface_set_native (GDK_MACOS_SURFACE (self), window);
/* Allow NSWindow to go fullscreen */
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
_gdk_macos_surface_set_native (GDK_MACOS_SURFACE (self), window);
frame_clock = _gdk_frame_clock_idle_new ();
gdk_surface_set_frame_clock (surface, frame_clock);
g_object_unref (frame_clock);