Skip to content

Commit

Permalink
Wait for the fullscreen transition to complete before allowing the ap…
Browse files Browse the repository at this point in the history
…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 65133eb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -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];
Expand Down

0 comments on commit 65133eb

Please sign in to comment.