diff options
author | Morten Sorvig <morten.sorvig@nokia.com> | 2011-10-04 09:54:38 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-04 13:29:13 +0200 |
commit | 5066c914bdf8a911eb769abb4003e154334a459c (patch) | |
tree | d7cf9ae44eaa0561abd921be9f1581bcdd40da30 /src/plugins/platforms/cocoa | |
parent | 4ebc83745d21072952527f87a43906ea2b71fc27 (diff) |
Cocoa: Add env variable for disabling foreground.
Setting QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM
prevents the process from having an dock icon and
taking focus.
Change-Id: Id127967d8ec1dadda790128f36a7c1f50d581433
Reviewed-on: http://codereview.qt-project.org/5968
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Zeno Albisser <zeno.albisser@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaintegration.mm | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index bb17c8eef7..63993146bd 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -87,18 +87,20 @@ QCocoaIntegration::QCocoaIntegration() QNSApplication *cocoaApplication = [QNSApplication sharedApplication]; - // Applications launched from plain executables (without an app - // bundle) are "background" applications that does not take keybaord - // focus or have a dock icon or task switcher entry. Qt Gui apps generally - // wants to be foreground applications so change the process type. (But - // 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]; + if (qgetenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM").isEmpty()) { + // Applications launched from plain executables (without an app + // bundle) are "background" applications that does not take keybaord + // focus or have a dock icon or task switcher entry. Qt Gui apps generally + // wants to be foreground applications so change the process type. (But + // 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]; + } // ### For AA_MacPluginApplication we don't want to load the menu nib. // Qt 4 also does not set the application delegate, so that behavior |