summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-13 09:36:26 +0100
committerLiang Qi <liang.qi@qt.io>2016-12-13 09:39:20 +0100
commit6755ec891a1740110c48895afd53d39e8370704a (patch)
tree982606f3bc582262e4b315a63f55ccb141fff97b /src/plugins/platforms/cocoa
parent449204f8c0d6679ae0e58dbb8a30b8a86fbdb4ec (diff)
parent00c9ec63a552d040e851b561c11428fabf1a2b08 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: configure qmake/Makefile.unix.macos qmake/Makefile.unix.win32 qmake/generators/win32/msvc_vcproj.cpp src/3rdparty/pcre/qt_attribution.json src/corelib/io/qsettings.cpp src/corelib/kernel/qdeadlinetimer.cpp src/platformsupport/kmsconvenience/qkmsdevice.cpp src/platformsupport/kmsconvenience/qkmsdevice_p.h src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h tests/manual/qstorageinfo/printvolumes.cpp tools/configure/configureapp.cpp Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/COCOA_LICENSE.txt29
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm14
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm14
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm2
-rw-r--r--src/plugins/platforms/cocoa/qt_attribution.json13
5 files changed, 61 insertions, 11 deletions
diff --git a/src/plugins/platforms/cocoa/COCOA_LICENSE.txt b/src/plugins/platforms/cocoa/COCOA_LICENSE.txt
new file mode 100644
index 0000000000..8c08f48528
--- /dev/null
+++ b/src/plugins/platforms/cocoa/COCOA_LICENSE.txt
@@ -0,0 +1,29 @@
+Copyright (c) 2007-2008, Apple, Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of Apple, Inc. nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index da755aa189..7368aabf7d 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -282,14 +282,18 @@ QT_END_NAMESPACE
{
Q_UNUSED(aNotification);
inLaunch = false;
- // qt_release_apple_event_handler();
-
- // Insert code here to initialize your application
+ if (qEnvironmentVariableIsEmpty("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM")) {
+ if (QSysInfo::macVersion() >= QSysInfo::MV_10_12) {
+ // 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];
+ }
+ }
}
-
-
- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
{
Q_UNUSED(filenames);
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.
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
index b8a64641a8..e32ff26ff5 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
@@ -360,7 +360,7 @@ NSMenuItem *QCocoaMenuItem::sync()
NSImage *img = nil;
if (!m_icon.isNull()) {
- img = qt_mac_create_nsimage(m_icon);
+ img = qt_mac_create_nsimage(m_icon, m_iconSize);
[img setSize:NSMakeSize(m_iconSize, m_iconSize)];
}
[m_native setImage:img];
diff --git a/src/plugins/platforms/cocoa/qt_attribution.json b/src/plugins/platforms/cocoa/qt_attribution.json
new file mode 100644
index 0000000000..37c0937f29
--- /dev/null
+++ b/src/plugins/platforms/cocoa/qt_attribution.json
@@ -0,0 +1,13 @@
+{
+ "Id": "cocoa-platform-plugin",
+ "Name": "Cocoa Platform Plugin",
+ "QDocModule": "qtgui",
+ "QtUsage": "Code used in the Qt Platform Abstraction (QPA) for macOS.",
+ "Files": "qcocoaapplication.h qcocoaapplication.mm qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm qcocoaeventdispatcher.h qcocoaeventdispatcher.mm qcocoaintrospection.h qcocoaintrospection.mm qcocoasystemtrayicon.mm qmacdefines_mac.h",
+
+ "Description": "Allows Qt to integrate into Apple's Cocoa API.",
+ "LicenseId": "BSD-3-Clause",
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseFile": "COCOA_LICENSE.txt",
+ "Copyright": "Copyright (c) 2007-2008, Apple, Inc."
+}