diff options
authorMorten Sorvig <>2011-08-11 12:27:29 +0200
committerGunnar Sletta <>2011-08-11 12:38:07 +0200
commit845291ba19f106c7e5e54bd4444f09a83d01f31c (patch)
parent3c36a52e1b536d35a19f27ffde8a28e6f5da7659 (diff)
Cocoa: Activate Qt apps on startup.
This prevents Qt apps from launching behind the terminal and QProcess parent apps, which is the native OS X but not the cross-platform Qt behavior. This reverses the change made mid 4.x series and reverts back to the "old" Qt 4 behavior Change-Id: I99d9f95980db884f8614ec2df663305505e08531 Reviewed-on: Reviewed-by: Qt Sanity Bot <> Reviewed-by: Gunnar Sletta <>
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/ b/src/plugins/platforms/cocoa/
index 6c10ed6692..3e03b1a23d 100644
--- a/src/plugins/platforms/cocoa/
+++ b/src/plugins/platforms/cocoa/
@@ -80,6 +80,12 @@ QCocoaIntegration::QCocoaIntegration()
[NSApplication sharedApplication];
// [[OurApplication alloc] init];
+ // 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.)
+ [[NSApplication sharedApplication] activateIgnoringOtherApps : YES];
NSArray *screens = [NSScreen screens];
for (uint i = 0; i < [screens count]; i++) {
QCocoaScreen *screen = new QCocoaScreen(i);