From 56e2a7e8bb8ba1d69db9d803aa34f59d289facee Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 24 Feb 2022 22:31:42 -0800 Subject: [PATCH] macos: restore unfullscreen frame with style mask This doesn't give us appropriate results if we use the window delegate. Instead, we need to adjust the frame at the same time we change the style mask so that we end up in the same location. --- gdk/macos/GdkMacosWindow.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c index f879decbc9..3ed60cb049 100644 --- a/gdk/macos/GdkMacosWindow.c +++ b/gdk/macos/GdkMacosWindow.c @@ -668,7 +668,12 @@ typedef NSString *CALayerContentsGravity; is_opaque = (([self styleMask] & NSWindowStyleMaskTitled) != 0); if (was_fullscreen != is_fullscreen) - _gdk_macos_surface_update_fullscreen_state (gdk_surface); + { + if (was_fullscreen) + [self setFrame:lastUnfullscreenFrame display:NO]; + + _gdk_macos_surface_update_fullscreen_state (gdk_surface); + } if (was_opaque != is_opaque) { @@ -753,7 +758,6 @@ typedef NSString *CALayerContentsGravity; -(void)windowWillExitFullScreen:(NSNotification *)aNotification { - [self setFrame:lastUnfullscreenFrame display:NO]; } -(void)windowDidExitFullScreen:(NSNotification *)aNotification