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

This commit is contained in:
Brecht Van Lommel 2016-08-03 02:39:29 +02:00
parent 75f37feb5c
commit 70100b4ec7
Notes: blender-bot 2023-02-14 08:45:12 +01:00
Referenced by issue #49010, Portals seem to be broken
Referenced by issue #48283, OSX: GUI left-click is broken after long Python script on startup
2 changed files with 10 additions and 2 deletions

View File

@ -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);

View File

@ -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];
}