summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaintegration.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaintegration.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index db483949e0..6e145682a1 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -328,11 +328,15 @@ QCocoaIntegration::QCocoaIntegration(const QStringList &paramList)
// see the function implementation for exceptions.)
qt_mac_transformProccessToForegroundApplication();
- // Move the application window to front to avoid launching behind the terminal.
- // Ignoring other apps is neccessary (we must ignore the terminal), but makes
- // Qt apps play slightly less nice with other apps when lanching from Finder
- // (See the activateIgnoringOtherApps docs.)
- [cocoaApplication activateIgnoringOtherApps : YES];
+ // Move the application window to front to make it take focus, also when launching
+ // from the terminal. On 10.12+ this call has been moved to applicationDidFinishLauching
+ // to work around issues with loss of focus at startup.
+ if (QSysInfo::macVersion() < QSysInfo::MV_10_12) {
+ // Ignoring other apps is neccessary (we must ignore the terminal), but makes
+ // Qt apps play slightly less nice with other apps when lanching from Finder
+ // (See the activateIgnoringOtherApps docs.)
+ [cocoaApplication activateIgnoringOtherApps : YES];
+ }
}
// ### For AA_MacPluginApplication we don't want to load the menu nib.