OSX/GHOST: fix own issue in 60510, should now (hopefully) cover all multiple window...
[blender.git] / intern / ghost / intern / GHOST_SystemCocoa.mm
index 770cfca69686ca6f361822fe856ffcc3cf32a231..fcf395239171bc12c8a8951d055977fb15a70ee3 100644 (file)
@@ -1025,10 +1025,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
        }
                switch (eventType) {
                        case GHOST_kEventWindowClose:
-                               // make window that should be closed frontmost
-                               [window->getCocoaWindow() makeKeyAndOrderFront:nil];
                                // check for index of mainwindow as it would quit blender without dialog and discard
-                               if (window->getCocoaWindow() != [windowsList objectAtIndex:([windowsList count] - 1)]) {
+                               if ([windowsList count] > 1  && window->getCocoaWindow() != [windowsList objectAtIndex:[windowsList count] - 1]) {
                                        pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowClose, window) );
                                }
                                else {