Commit b2ba8963b3e3dc3c0ba496b3609fa418929ed9e4

Sam Lantinga 2017-09-09T11:00:25

Fixed bug 3809 - Restore after maximize leads to wrong size Andreas Falkenhahn My app opens a 640x480 window. When I click on the window's maximize button, the window correctly fills the entire screen and loses its borders. But clicking on the restore button now doesn't restore the window to its original 640x480 size. Instead, the window size is identical to the screen size now. The only difference to the previous state is that the window now has borders again but it isn't restored to 640x480.

diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index f35220b..c92590b 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -787,6 +787,13 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
 
         pendingWindowOperation = PENDING_OPERATION_NONE;
 
+#if 0
+/* This fixed bug 3719, which is that changing window size while fullscreen
+   doesn't take effect when leaving fullscreen, but introduces bug 3809,
+   which is that a maximized window doesn't go back to normal size when
+   restored, so this code is disabled until we can properly handle the
+   beginning and end of maximize and restore.
+ */
         /* Restore windowed size and position in case it changed while fullscreen */
         {
             NSRect rect;
@@ -801,6 +808,7 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
             [nswindow setFrameOrigin:rect.origin];
             s_moveHack = SDL_GetTicks();
         }
+#endif /* 0 */
 
         /* Force the size change event in case it was delivered earlier
            while the window was still animating into place.