[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52975] trunk/blender/intern/ghost/intern/ GHOST_WindowCocoa.mm: Bugfix, IRC report

Ton Roosendaal ton at blender.org
Thu Dec 13 15:25:19 CET 2012


Revision: 52975
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52975
Author:   ton
Date:     2012-12-13 14:25:15 +0000 (Thu, 13 Dec 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm	2012-12-13 13:20:01 UTC (rev 52974)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm	2012-12-13 14:25:15 UTC (rev 52975)
@@ -622,14 +622,19 @@
 		// 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];
 }
 




More information about the Bf-blender-cvs mailing list