Commit: 70100b4ec7ba299912bf999f15914c0a29125ffd
Author: Brecht Van Lommel
Date:   Wed Aug 3 02:39:29 2016 +0200
Branches: master
https://developer.blender.org/rB70100b4ec7ba299912bf999f15914c0a29125ffd

Fix T48283: on OS X, mouse clicks not working properly if application launch 
takes a long time.

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

M       intern/ghost/intern/GHOST_SystemCocoa.mm
M       intern/ghost/intern/GHOST_WindowCocoa.mm

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

diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm 
b/intern/ghost/intern/GHOST_SystemCocoa.mm
index bce3907..4b8cb53 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -289,6 +289,7 @@ extern "C" int GHOST_HACK_getFirstFile(char 
buf[FIRSTFILEBUFLG])
        GHOST_SystemCocoa *systemCocoa;
 }
 - (void)setSystemCocoa:(GHOST_SystemCocoa *)sysCocoa;
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
 - (BOOL)application:(NSApplication *)theApplication openFile:(NSString 
*)filename;
 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication 
*)sender;
 - (void)applicationWillTerminate:(NSNotification *)aNotification;
@@ -302,6 +303,15 @@ extern "C" int GHOST_HACK_getFirstFile(char 
buf[FIRSTFILEBUFLG])
        systemCocoa = sysCocoa;
 }
 
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+       // raise application to front, convenient when starting from the 
terminal
+       // and important for launching the animation player. we call this after 
the
+       // application finishes launching, as doing it earlier can make us end 
up
+       // with a frontmost window but an inactive application
+       [NSApp activateIgnoringOtherApps:YES];
+}
+
 - (BOOL)application:(NSApplication *)theApplication openFile:(NSString 
*)filename
 {
        return systemCocoa->handleOpenDocumentRequest(filename);
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm 
b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 00e00b6..e23cf9c 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -622,8 +622,6 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
                m_lionStyleFullScreen = true;
        }
        
-       [NSApp activateIgnoringOtherApps:YES]; // raise application to front, 
important for new blender instance animation play case
-       
        [pool drain];
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to