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.
This commit is contained in:
Frank Praznik
2026-07-14 22:10:12 -04:00
parent 2d7f300783
commit 1a9801a16f

View File

@@ -1430,12 +1430,18 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
}
/* This is usually sent after an unexpected windowDidExitFullscreen if the window
* failed to become fullscreen.
* failed to become fullscreen, but not always, so ensure that the state variables
* are cleared.
*
* Since something went wrong and the current state is unknown, dump any pending events.
*
* For testing purposes, this error can usually be induced by starting something that
* immedately enters a fullscreen space from a terminal that is in a fullscreen space.
*/
- (void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification
{
inFullscreenTransition = NO;
isFullscreenSpace = NO;
[self clearAllPendingWindowOperations];
}