summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-08-11 12:27:29 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-08-11 12:38:07 +0200
commit845291ba19f106c7e5e54bd4444f09a83d01f31c (patch)
treed122ecfe0a637284fa8f3527441e695e932038ea /src/plugins/platforms/cocoa
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: http://codereview.qt.nokia.com/2858 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 6c10ed6692..3e03b1a23d 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -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);