summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-06-19 13:12:48 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-06-19 13:12:48 +0200
commit8eabb44f8a3f5c22aed44fbd3e1919cc7e04b1a5 (patch)
tree816f551efc48349b1f08f2899b7a88f0fa6aa882 /src/gui
parentd0acd26c37c7b98612308e47e635b792949d7210 (diff)
parent74305ba470f48da8b4c4e806fc714fe9f7649156 (diff)
Merge remote-tracking branch 'origin/5.11.1' into 5.11
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index c73dac42d6..2ef689b5b9 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1297,10 +1297,18 @@ void QGuiApplicationPrivate::createPlatformIntegration()
#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")))
+ if (sessionType == QByteArrayLiteral("x11") && !platformName.contains(QByteArrayLiteral("xcb"))) {
platformName = QByteArrayLiteral("xcb");
- else if (sessionType == QByteArrayLiteral("wayland") && !platformName.contains(QByteArrayLiteral("wayland")))
- platformName = QByteArrayLiteral("wayland");
+ } else if (sessionType == QByteArrayLiteral("wayland") && !platformName.contains(QByteArrayLiteral("wayland"))) {
+ QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP").toLower();
+ QByteArray sessionDesktop = qgetenv("XDG_SESSION_DESKTOP").toLower();
+ if (currentDesktop.contains("gnome") || sessionDesktop.contains("gnome")) {
+ qInfo() << "Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome."
+ << "Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.";
+ } else {
+ platformName = QByteArrayLiteral("wayland");
+ }
+ }
}
#ifdef QT_QPA_DEFAULT_PLATFORM_NAME
// Add it as fallback in case XDG_SESSION_TYPE is something wrong