Browse Source

cocoa: Clear the pending flags on non-spaces fullscreen transitions

Transitions to or from a non-spaces fullscreen state are synchronous, so clear both the enter and leave pending flags when changing the state.
Frank Praznik 5 months ago
parent
commit
df73cae2b0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/video/cocoa/SDL_cocoawindow.m

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

@@ -2741,7 +2741,8 @@ SDL_FullscreenResult Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Windo
         NSWindow *nswindow = data.nswindow;
         NSRect rect;
 
-        [data.listener clearPendingWindowOperation:PENDING_OPERATION_ENTER_FULLSCREEN];
+        // This is a synchronous operation, so always clear the pending flags.
+        [data.listener clearPendingWindowOperation:PENDING_OPERATION_ENTER_FULLSCREEN | PENDING_OPERATION_LEAVE_FULLSCREEN];
 
         // The view responder chain gets messed with during setStyleMask
         if ([data.sdlContentView nextResponder] == data.listener) {