gdkmacossurface: Set surface before accessing it

Silences the following critial:
_gdk_macos_surface_update_fullscreen_state: assertion
'GDK_IS_MACOS_SURFACE (self)' failed
This commit is contained in:
Mat 2024-05-19 23:53:41 +03:00
parent af0c277bba
commit ed8255993f
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);