浏览代码

cocoa: Workaround for an issue with incorrect window position after exiting fullscreen on some displays

Fix for https://github.com/libsdl-org/SDL/issues/15920
Michal Trepka 2 月之前
父节点
当前提交
f514394d1c
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/video/cocoa/SDL_cocoawindow.m

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

@@ -1572,7 +1572,10 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
         } else {
             [nswindow setCollectionBehavior:NSWindowCollectionBehaviorManaged];
         }
-        [NSMenu setMenuBarVisible:YES];
+
+        if (![NSMenu menuBarVisible]) {
+            [NSMenu setMenuBarVisible:YES];
+        }
 
         // Toggle zoom, if changed while fullscreen.
         if ([self windowOperationIsPending:PENDING_OPERATION_ZOOM]) {