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.
This commit is contained in:
Christian Hergert 2022-02-24 22:31:42 -08:00
parent 617deb8bb6
commit 56e2a7e8bb

View File

@ -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