Skip to content
Permalink
Browse files

Wait for the fullscreen transition to complete before allowing the ap…

…plication to continue.

This fixes Alt-Enter in the Steam streaming client, which sets the window size and position immediately after switching out of fullscreen mode.
  • Loading branch information
slouken committed Jun 4, 2014
1 parent 16360b1 commit 65133ebc1b556406715e83415c3f67cca031dfd5
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/video/cocoa/SDL_cocoawindow.m
@@ -1544,6 +1544,20 @@ - (void)resetCursorRects

if ([data->listener setFullscreenSpace:(state ? YES : NO)]) {
succeeded = SDL_TRUE;

/* Wait for the transition to complete, so application changes
take effect properly (e.g. setting the window size, etc.)
*/
const int limit = 10000;
int count = 0;
while ([data->listener isInFullscreenSpaceTransition]) {
if ( ++count == limit ) {
/* Uh oh, transition isn't completing. Should we assert? */
break;
}
SDL_Delay(1);
SDL_PumpEvents();
}
}

[pool release];

0 comments on commit 65133eb

Please sign in to comment.