Skip to content

Commit 1a9801a

Browse files
committed
cocoa: Clear state on failure to enter fullscreen
A fullscreen exit event doesn't always accompany an entry error, so ensure that all relevant state is cleared if the window fails to enter fullscreen.
1 parent 2d7f300 commit 1a9801a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/video/cocoa/SDL_cocoawindow.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,12 +1430,18 @@ - (void)windowWillEnterFullScreen:(NSNotification *)aNotification
14301430
}
14311431

14321432
/* This is usually sent after an unexpected windowDidExitFullscreen if the window
1433-
* failed to become fullscreen.
1433+
* failed to become fullscreen, but not always, so ensure that the state variables
1434+
* are cleared.
14341435
*
14351436
* Since something went wrong and the current state is unknown, dump any pending events.
1437+
*
1438+
* For testing purposes, this error can usually be induced by starting something that
1439+
* immedately enters a fullscreen space from a terminal that is in a fullscreen space.
14361440
*/
14371441
- (void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification
14381442
{
1443+
inFullscreenTransition = NO;
1444+
isFullscreenSpace = NO;
14391445
[self clearAllPendingWindowOperations];
14401446
}
14411447

0 commit comments

Comments
 (0)