Fixed bug 3809 - Restore after maximize leads to wrong size
authorSam Lantinga <slouken@libsdl.org>
Sat, 09 Sep 2017 11:00:25 -0700
changeset 114836f723ec1d371
parent 11482 05aa6d232dca
child 11484 7051f0e04ebc
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.
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sat Sep 09 10:31:44 2017 -0700
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sat Sep 09 11:00:25 2017 -0700
     1.3 @@ -787,6 +787,13 @@
     1.4  
     1.5          pendingWindowOperation = PENDING_OPERATION_NONE;
     1.6  
     1.7 +#if 0
     1.8 +/* This fixed bug 3719, which is that changing window size while fullscreen
     1.9 +   doesn't take effect when leaving fullscreen, but introduces bug 3809,
    1.10 +   which is that a maximized window doesn't go back to normal size when
    1.11 +   restored, so this code is disabled until we can properly handle the
    1.12 +   beginning and end of maximize and restore.
    1.13 + */
    1.14          /* Restore windowed size and position in case it changed while fullscreen */
    1.15          {
    1.16              NSRect rect;
    1.17 @@ -801,6 +808,7 @@
    1.18              [nswindow setFrameOrigin:rect.origin];
    1.19              s_moveHack = SDL_GetTicks();
    1.20          }
    1.21 +#endif /* 0 */
    1.22  
    1.23          /* Force the size change event in case it was delivered earlier
    1.24             while the window was still animating into place.