summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-05 10:02:08 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-05 10:02:09 +0200
commitbfe5e510b90684d016fb0c68114f85708f7cffda (patch)
tree0ae25857ca1f50bd04ea1b405afcf863b082b012 /src/gui/kernel
parent6ada4155aff6a106d918ec1b93923bed9617ab27 (diff)
parent4b4870a12cd920cd45c534deae7ca90716398a19 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qguiapplication.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 12390928f0..caa8aaca4b 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -591,6 +591,12 @@ static QWindowGeometrySpecification windowGeometrySpecification = Q_WINDOW_GEOME
applications.
\endlist
+ The following parameter is available for \c {-platform cocoa} (on macOS):
+
+ \list
+ \li \c {fontengine=freetype}, uses the FreeType font engine.
+ \endlist
+
For more information about the platform-specific arguments available for
embedded Linux platforms, see \l{Qt for Embedded Linux}.
@@ -1285,6 +1291,21 @@ void QGuiApplicationPrivate::createPlatformIntegration()
#ifdef QT_QPA_DEFAULT_PLATFORM_NAME
platformName = QT_QPA_DEFAULT_PLATFORM_NAME;
#endif
+#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
+ QByteArray sessionType = qgetenv("XDG_SESSION_TYPE");
+ if (!sessionType.isEmpty()) {
+ if (sessionType == QByteArrayLiteral("x11") && !platformName.contains(QByteArrayLiteral("xcb")))
+ platformName = QByteArrayLiteral("xcb");
+ else if (sessionType == QByteArrayLiteral("wayland") && !platformName.contains(QByteArrayLiteral("wayland")))
+ platformName = QByteArrayLiteral("wayland");
+ }
+#ifdef QT_QPA_DEFAULT_PLATFORM_NAME
+ // Add it as fallback in case XDG_SESSION_TYPE is something wrong
+ if (!platformName.contains(QT_QPA_DEFAULT_PLATFORM_NAME))
+ platformName += QByteArrayLiteral(";" QT_QPA_DEFAULT_PLATFORM_NAME);
+#endif
+#endif
+
QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM");
if (!platformNameEnv.isEmpty()) {
platformName = platformNameEnv;