Browse Source

cocoa: Don't sync on a pending fullscreen event if the window is miniaturized

The fullscreen event will be processed after deminiaturization is complete. Fixes a delay when restoring a miniaturized window that will return to fullscreen.
Frank Praznik 5 months ago
parent
commit
aa352837d5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/video/cocoa/SDL_cocoawindow.m

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

@@ -2637,8 +2637,8 @@ void Cocoa_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window)
         SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal;
         NSWindow *nswindow = data.nswindow;
 
-        if ([data.listener windowOperationIsPending:(PENDING_OPERATION_ENTER_FULLSCREEN | PENDING_OPERATION_LEAVE_FULLSCREEN)] ||
-            [data.listener isInFullscreenSpaceTransition]) {
+        if (([data.listener windowOperationIsPending:(PENDING_OPERATION_ENTER_FULLSCREEN | PENDING_OPERATION_LEAVE_FULLSCREEN)] &&
+            ![data.nswindow isMiniaturized]) || [data.listener isInFullscreenSpaceTransition]) {
             Cocoa_SyncWindow(_this, window);
         }