diff options
author | Ton Roosendaal <ton@blender.org> | 2012-12-13 18:25:15 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-12-13 18:25:15 +0400 |
commit | d06876f45ab479dd8c2defb52299222b57f81ec4 (patch) | |
tree | 479400f954ae51d42c9c48cf1b9605a2aad43b67 /intern | |
parent | c12a1368fffef138ccea71442285e228ab7d27a8 (diff) |
Bugfix, IRC report
(Error in 2.65 release too)
Mac OS X: on closing Blender, it 'flashed', which appeared to be a white window opening
and closing quickly. Caused by code trying to send focus to another opened window, and
accidentally focusing the closed one - causing it to reopen.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 2c833fcaf9d..e044967fdef 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -622,14 +622,19 @@ GHOST_WindowCocoa::~GHOST_WindowCocoa() // back to YES right before closing [m_window setReleasedWhenClosed:YES]; [m_window close]; - m_window = nil; } - //Check for other blender opened windows and make the frontmost key + // Check for other blender opened windows and make the frontmost key + // Note: for some reason the closed window is still in the list NSArray *windowsList = [NSApp orderedWindows]; - if ([windowsList count]) { - [[windowsList objectAtIndex:0] makeKeyAndOrderFront:nil]; + for (int a = 0; a < [windowsList count]; a++) { + if (m_window != (CocoaWindow *)[windowsList objectAtIndex:a]) { + [[windowsList objectAtIndex:a] makeKeyAndOrderFront:nil]; + break; + } } + m_window = nil; + [pool drain]; } |