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.
Sam Lantinga 2017-09-09 11:00:25 -07:00
parent 676c3a9263
commit b2ba8963b3
1 changed files with 8 additions and 0 deletions

View File

@ -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.