mirror of https://github.com/encounter/SDL.git
Fixed assertion when quickly toggling from fullscreen back to fullscreen:
"Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'backgroundWindows not nil in enterFullScreenTransitionWithOptions:animated:activatingIt:'" To reproduce this, run testsprite2, press Alt-Enter once, again while it's animating to fullscreen, and then again while it's animating out of fullscreen.
This commit is contained in:
parent
8f8070db42
commit
cb190b8270
|
@ -184,10 +184,6 @@ GetWindowStyle(SDL_Window * window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-(BOOL) canSetFullscreenState:(BOOL) state;
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
-(BOOL) setFullscreenState:(BOOL) state;
|
-(BOOL) setFullscreenState:(BOOL) state;
|
||||||
{
|
{
|
||||||
SDL_Window *window = _data->window;
|
SDL_Window *window = _data->window;
|
||||||
|
@ -228,7 +224,7 @@ GetWindowStyle(SDL_Window * window)
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
[nswindow performSelector: @selector(toggleFullScreen:) withObject:nswindow];
|
[nswindow performSelectorOnMainThread: @selector(toggleFullScreen:) withObject:nswindow waitUntilDone:NO];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,12 +429,15 @@ GetWindowStyle(SDL_Window * window)
|
||||||
[nswindow setStyleMask:NSBorderlessWindowMask];
|
[nswindow setStyleMask:NSBorderlessWindowMask];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isFullscreen = YES;
|
isFullscreen = YES;
|
||||||
inFullscreenTransition = YES;
|
inFullscreenTransition = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidEnterFullScreen:(NSNotification *)aNotification
|
- (void)windowDidEnterFullScreen:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
|
SDL_Window *window = _data->window;
|
||||||
|
|
||||||
inFullscreenTransition = NO;
|
inFullscreenTransition = NO;
|
||||||
|
|
||||||
if (pendingWindowOperation == PENDING_OPERATION_LEAVE_FULLSCREEN) {
|
if (pendingWindowOperation == PENDING_OPERATION_LEAVE_FULLSCREEN) {
|
||||||
|
@ -446,6 +445,11 @@ GetWindowStyle(SDL_Window * window)
|
||||||
[self setFullscreenState:NO];
|
[self setFullscreenState:NO];
|
||||||
} else {
|
} else {
|
||||||
pendingWindowOperation = PENDING_OPERATION_NONE;
|
pendingWindowOperation = PENDING_OPERATION_NONE;
|
||||||
|
/* Force the size change event in case it was delivered earlier
|
||||||
|
while the window was still animating into place.
|
||||||
|
*/
|
||||||
|
window->w = 0;
|
||||||
|
window->h = 0;
|
||||||
[self windowDidResize:aNotification];
|
[self windowDidResize:aNotification];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,6 +469,7 @@ GetWindowStyle(SDL_Window * window)
|
||||||
|
|
||||||
- (void)windowDidExitFullScreen:(NSNotification *)aNotification
|
- (void)windowDidExitFullScreen:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
|
SDL_Window *window = _data->window;
|
||||||
NSWindow *nswindow = _data->nswindow;
|
NSWindow *nswindow = _data->nswindow;
|
||||||
|
|
||||||
inFullscreenTransition = NO;
|
inFullscreenTransition = NO;
|
||||||
|
@ -477,6 +482,11 @@ GetWindowStyle(SDL_Window * window)
|
||||||
[nswindow miniaturize:nil];
|
[nswindow miniaturize:nil];
|
||||||
} else {
|
} else {
|
||||||
pendingWindowOperation = PENDING_OPERATION_NONE;
|
pendingWindowOperation = PENDING_OPERATION_NONE;
|
||||||
|
/* Force the size change event in case it was delivered earlier
|
||||||
|
while the window was still animating into place.
|
||||||
|
*/
|
||||||
|
window->w = 0;
|
||||||
|
window->h = 0;
|
||||||
[self windowDidResize:aNotification];
|
[self windowDidResize:aNotification];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue