Просмотр исходного кода

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.
Frank Praznik 2 месяцев назад
Родитель
Сommit
1a9801a16f
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      src/video/cocoa/SDL_cocoawindow.m

+ 7 - 1
src/video/cocoa/SDL_cocoawindow.m

@@ -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];
 }