瀏覽代碼

cocoa: Fix zoom check when leaving fullscreen

Non-resizable windows will always report as zoomed, so isZoomed is not a reliable check here.
Frank Praznik 5 月之前
父節點
當前提交
79081a178f
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/video/cocoa/SDL_cocoawindow.m

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

@@ -1504,9 +1504,10 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
         if ([self windowOperationIsPending:PENDING_OPERATION_ZOOM]) {
             [self clearPendingWindowOperation:PENDING_OPERATION_ZOOM];
             [nswindow zoom:nil];
+            _data.was_zoomed = !_data.was_zoomed;
         }
 
-        if (![nswindow isZoomed]) {
+        if (!_data.was_zoomed) {
             // Apply a pending window size, if not zoomed.
             NSRect rect;
             rect.origin.x = _data.pending_position ? window->pending.x : window->floating.x;