From 70100b4ec7ba299912bf999f15914c0a29125ffd Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 3 Aug 2016 02:39:29 +0200 Subject: Fix T48283: on OS X, mouse clicks not working properly if application launch takes a long time. --- intern/ghost/intern/GHOST_SystemCocoa.mm | 10 ++++++++++ intern/ghost/intern/GHOST_WindowCocoa.mm | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index bce390732fe..4b8cb537ecf 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 00e00b6a1ea..e23cf9ccd37 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]; } -- cgit v1.2.3