瀏覽代碼

Cocoa: Fix full screen window not being restorable

Once a full screen window was iconified, it would appear to restore but
then disappear.

Fixes #848.
Camilla Löwy 8 年之前
父節點
當前提交
3d8aa53573
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 1 0
      README.md
  2. 6 1
      src/cocoa_window.m

+ 1 - 0
README.md

@@ -185,6 +185,7 @@ information on what to include when reporting a bug.
 - [Cocoa] Bugfix: Windows created after the first were not cascaded (#195)
 - [Cocoa] Bugfix: Leaving video mode with `glfwSetWindowMonitor` would set
                   incorrect position and size (#748)
+- [Cocoa] Bugfix: Iconified full screen windows could not be restored (#848)
 - [X11] Moved to XI2 `XI_RawMotion` for disable cursor mode motion input (#125)
 - [EGL] Added support for `EGL_KHR_get_all_proc_addresses` (#871)
 - [EGL] Bugfix: The test for `EGL_RGB_BUFFER` was invalid

+ 6 - 1
src/cocoa_window.m

@@ -1025,7 +1025,12 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
         _glfw.ns.cascadePoint = [window->ns.object cascadeTopLeftFromPoint:_glfw.ns.cascadePoint];
 
         if (wndconfig->resizable)
-            [window->ns.object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
+        {
+            const NSWindowCollectionBehavior behavior =
+                NSWindowCollectionBehaviorFullScreenPrimary |
+                NSWindowCollectionBehaviorManaged;
+            [window->ns.object setCollectionBehavior:behavior];
+        }
 
         if (wndconfig->floating)
             [window->ns.object setLevel:NSFloatingWindowLevel];