Browse Source

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
David Ludwig 7 years ago
parent
commit
532446a6bd
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/video/cocoa/SDL_cocoawindow.m

+ 7 - 0
src/video/cocoa/SDL_cocoawindow.m

@@ -796,6 +796,13 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
             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);