From 532446a6bd5a442b7eef8074500e25ca84c6774d Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sun, 3 Sep 2017 17:33:49 -0400 Subject: [PATCH] macOS: bug-fix for #3793, "fullscreen toggle does not maintain SDL_Renderer's logical size" This also seems to fix the follow-up issue in bug #3719, whereby the initial fix caused the SDL window to move, after transitioning from fullscreen to windowed-mode --- src/video/cocoa/SDL_cocoawindow.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 659bf92502d28..a2d14f6d13778 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -796,6 +796,13 @@ - (void)windowDidExitFullScreen:(NSNotification *)aNotification s_moveHack = SDL_GetTicks(); } + /* Force the size change event in case it was delivered earlier + while the window was still animating into place. + */ + window->w = 0; + window->h = 0; + [self windowDidResize:aNotification]; + /* FIXME: Why does the window get hidden? */ if (window->flags & SDL_WINDOW_SHOWN) { Cocoa_ShowWindow(SDL_GetVideoDevice(), window);