[Bf-blender-cvs] [60bf482dba7] blender-v2.83-release: Fix T74101: File Browser in macOS fullscreen crashes or makes windows unusable

Julian Eisel noreply at git.blender.org
Thu Jun 18 10:15:24 CEST 2020


Commit: 60bf482dba721e3878770e6abefa3b35acca0021
Author: Julian Eisel
Date:   Wed Jun 10 18:05:30 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB60bf482dba721e3878770e6abefa3b35acca0021

Fix T74101: File Browser in macOS fullscreen crashes or makes windows unusable

When closing the File Browser window after making it fullscreen, Blender would
either crash or all windows would disappear, with no obvious way to bring them
back.

The "fix" is to not allow fullscreen for File Browsers (or any future "dialog"
windows), but only maximizing. From what I can tell that's how secondary
windows are supposed to work on macOS. What we previously did seemed like
something macOS doesn't handle cleanly, and I didn't find a simple way to do so
on our side.

===================================================================

M	intern/ghost/intern/GHOST_WindowCocoa.mm

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 10ab05a0de1..278147c5622 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -411,17 +411,17 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
                                                               NSTIFFPboardType,
                                                               nil]];
 
-  if (state != GHOST_kWindowStateFullScreen) {
+  if (is_dialog && parentWindow) {
+    [parentWindow->getCocoaWindow() addChildWindow:m_window ordered:NSWindowAbove];
+    [m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary];
+  }
+  else if (state != GHOST_kWindowStateFullScreen) {
     [m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
   }
 
   if (state == GHOST_kWindowStateFullScreen)
     setState(GHOST_kWindowStateFullScreen);
 
-  if (is_dialog && parentWindow) {
-    [parentWindow->getCocoaWindow() addChildWindow:m_window ordered:NSWindowAbove];
-  }
-
   setNativePixelSize();
 
   [pool drain];



More information about the Bf-blender-cvs mailing list