From: Christian Hergert Date: Fri, 25 Feb 2022 06:31:42 +0000 (-0800) Subject: macos: restore unfullscreen frame with style mask X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~3^2~7^2~52 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bad392eb2adfd21f93285f6609d1e0445c9f1839;p=gtk4.git 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. --- 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