diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-11-22 13:37:10 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2016-12-06 08:42:44 +0000 |
commit | e2f856d9da896c202d98b179b9482fe7e7b57222 (patch) | |
tree | d9b79e62827a2eae39c819f8a963a7637a3e620c /src/client/qwaylandintegration.cpp | |
parent | 542c6392ca52f86bd5fffb6141e93ad2a1ab8fcb (diff) |
Deprecate QT_WAYLAND_USE_XDG_SHELL
In favor of QT_WAYLAND_SHELL_INTEGRATION, which can be set to:
- ivi-shell
- wl-shell
- xdg-shell-v5
- xdg-shell-v6
Change-Id: Ie2ca1184f22dcac56beb441329ea8b5a9a81baf4
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/qwaylandintegration.cpp')
-rw-r--r-- | src/client/qwaylandintegration.cpp | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index 0dcd6b68f..f9ee61156 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -375,25 +375,25 @@ void QWaylandIntegration::initializeShellIntegration() QByteArray integrationName = qgetenv("QT_WAYLAND_SHELL_INTEGRATION"); QString targetKey = QString::fromLocal8Bit(integrationName); + QStringList preferredShells; if (!targetKey.isEmpty()) { - QStringList keys = QWaylandShellIntegrationFactory::keys(); - if (keys.contains(targetKey)) { - qDebug("Using the '%s' shell integration", qPrintable(targetKey)); - mShellIntegration.reset(QWaylandShellIntegrationFactory::create(targetKey, QStringList())); - } + preferredShells << targetKey; } else { - QStringList preferredShells; - preferredShells << QLatin1String("zxdg_shell_v6"); - if (qEnvironmentVariableIsSet("QT_WAYLAND_USE_XDG_SHELL")) - preferredShells << QLatin1String("xdg_shell"); - - preferredShells << QLatin1String("wl_shell"); - - Q_FOREACH (QString preferredShell, preferredShells) { - if (mDisplay->hasRegistryGlobal(preferredShell)) { - mShellIntegration.reset(createShellIntegration(preferredShell)); - break; - } + preferredShells << QLatin1String("xdg-shell-v6"); + QString useXdgShell = QString::fromLocal8Bit(qgetenv("QT_WAYLAND_USE_XDG_SHELL")); + if (!useXdgShell.isEmpty() && useXdgShell != QLatin1String("0")) { + qWarning() << "QT_WAYLAND_USE_XDG_SHELL is deprecated, " + "please specify the shell using QT_WAYLAND_SHELL_INTEGRATION instead"; + preferredShells << QLatin1String("xdg-shell-v5"); + } + preferredShells << QLatin1String("wl-shell"); + } + + Q_FOREACH (QString preferredShell, preferredShells) { + mShellIntegration.reset(createShellIntegration(preferredShell)); + if (mShellIntegration) { + qDebug("Using the '%s' shell integration", qPrintable(preferredShell)); + break; } } @@ -429,16 +429,18 @@ void QWaylandIntegration::initializeInputDeviceIntegration() } } -QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &interfaceName) +QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &integrationName) { - if (interfaceName == QLatin1Literal("wl_shell")) { - return new QWaylandWlShellIntegration(mDisplay.data()); - } else if (interfaceName == QLatin1Literal("xdg_shell")) { - return new QWaylandXdgShellIntegration(mDisplay.data()); - } else if (interfaceName == QLatin1Literal("zxdg_shell_v6")) { - return new QWaylandXdgShellV6Integration(mDisplay.data()); + if (integrationName == QLatin1Literal("wl-shell")) { + return QWaylandWlShellIntegration::create(mDisplay.data()); + } else if (integrationName == QLatin1Literal("xdg-shell-v5")) { + return QWaylandXdgShellIntegration::create(mDisplay.data()); + } else if (integrationName == QLatin1Literal("xdg-shell-v6")) { + return QWaylandXdgShellV6Integration::create(mDisplay.data()); + } else if (QWaylandShellIntegrationFactory::keys().contains(integrationName)) { + return QWaylandShellIntegrationFactory::create(integrationName, QStringList()); } else { - return Q_NULLPTR; + return nullptr; } } |