Ignore XDG_SESSION_TYPE=wayland on gnome-shell
[ChangeLog][Wayland] In Qt 5.11.0, support for selecting a platform plugin based on the XDG_SESSION_TYPE environment variable was added. On gnome-shell, however, bugs—in both Qt and gnome-shell—made many widget applications almost unusable. So until those bugs are fixed XDG_SESSION_TYPE=wayland is now ignored on gnome-shell. Task-number: QTBUG-68619 Change-Id: I902acd1c4fc996f46e8431c12c0a5cdbab883abf Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
a15db3a81a
commit
36d2ef5af9
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue