Ver código fonte

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 meses atrás
pai
commit
1a9801a16f
1 arquivos alterados com 7 adições e 1 exclusões
  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
 /* 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.
  * 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
 - (void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification
 {
 {
+    inFullscreenTransition = NO;
+    isFullscreenSpace = NO;
     [self clearAllPendingWindowOperations];
     [self clearAllPendingWindowOperations];
 }
 }