From 845291ba19f106c7e5e54bd4444f09a83d01f31c Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Thu, 11 Aug 2011 12:27:29 +0200 Subject: 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 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/cocoa/qcocoaintegration.mm | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v1.2.3