Skip to content

Commit

Permalink
Fixed bug 3809 - Restore after maximize leads to wrong size
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Sep 9, 2017
1 parent 676c3a9 commit b2ba896
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -787,6 +787,13 @@ - (void)windowDidExitFullScreen:(NSNotification *)aNotification

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;
Expand All @@ -801,6 +808,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)aNotification
[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.
Expand Down

0 comments on commit b2ba896

Please sign in to comment.