OSX/GHOST: refine #60409 and better take multiple windows into account
authorJens Verwiebe <info@jensverwiebe.de>
Wed, 2 Oct 2013 18:49:32 +0000 (18:49 +0000)
committerJens Verwiebe <info@jensverwiebe.de>
Wed, 2 Oct 2013 18:49:32 +0000 (18:49 +0000)
intern/ghost/intern/GHOST_SystemCocoa.mm

index f71d87c6f2fddc830d8f3c69fc1cd0bcd8983686..9cea4210769bc689eaa866082343756fd56863c3 100644 (file)
@@ -1025,8 +1025,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
        }
                switch (eventType) {
                        case GHOST_kEventWindowClose:
-                               // check for index 1 and discard close for mainwindow as it would quit blender without dialog
-                               if ([windowsList count] > 1 && (window->getCocoaWindow() != [windowsList objectAtIndex:1])) {
+                               // check for index of mainwindow as it would quit blender without dialog and discard
+                               if (window->getCocoaWindow() != [windowsList objectAtIndex:([windowsList count] - 1)]) {
                                        pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowClose, window) );
                                }
                                else {