summaryrefslogtreecommitdiffstats
path: root/src/client/shellintegration
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-05-08 16:31:16 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-05-09 11:04:35 +0000
commitf11c2993d2173d97ab74a36cac5603dff1c32997 (patch)
tree81e76f6dbbe94dbeb7bddbbde09bb31f6d6b85f2 /src/client/shellintegration
parent7344822dd3991fa4b914531d7e2a42b1c05c1e9d (diff)
Move xdg-shell-v5 to a plugin
This is the first step in deprecating xdg-shell unstable v5 and making the good names available for the good names for xdg-shell stable. Shell initialization has been refactored slightly, so the QWaylandShellIntegrationFactory actually tries to initialize the shell integration before returning it. Similarly for the factory method of non-plugin shells. Change-Id: I85e60594c4fc03c6f302c04316110aed428d28dc Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/shellintegration')
-rw-r--r--src/client/shellintegration/qwaylandshellintegrationfactory.cpp17
-rw-r--r--src/client/shellintegration/qwaylandshellintegrationfactory_p.h5
2 files changed, 15 insertions, 7 deletions
diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp
index c5a505bbe..48fda14d4 100644
--- a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp
+++ b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp
@@ -78,19 +78,24 @@ QStringList QWaylandShellIntegrationFactory::keys(const QString &pluginPath)
#endif
}
-QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
+QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, QWaylandDisplay *display, const QStringList &args, const QString &pluginPath)
{
#if QT_CONFIG(library)
+ QScopedPointer<QWaylandShellIntegration> integration;
+
// Try loading the plugin from platformPluginPath first:
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
- if (QWaylandShellIntegration *ret = qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(directLoader(), name, args))
- return ret;
+ integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(directLoader(), name, args));
}
- if (QWaylandShellIntegration *ret = qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args))
- return ret;
+ if (!integration)
+ integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args));
#endif
- return nullptr;
+
+ if (integration && !integration->initialize(display))
+ return nullptr;
+
+ return integration.take();
}
}
diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory_p.h b/src/client/shellintegration/qwaylandshellintegrationfactory_p.h
index 3edb0a89d..515a18e1f 100644
--- a/src/client/shellintegration/qwaylandshellintegrationfactory_p.h
+++ b/src/client/shellintegration/qwaylandshellintegrationfactory_p.h
@@ -51,7 +51,10 @@
// We mean it.
//
+#include <QtWaylandClient/private/qwaylanddisplay_p.h>
+
#include <QtWaylandClient/qtwaylandclientglobal.h>
+
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
@@ -64,7 +67,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationFactory
{
public:
static QStringList keys(const QString &pluginPath = QString());
- static QWaylandShellIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
+ static QWaylandShellIntegration *create(const QString &name, QWaylandDisplay *display, const QStringList &args = QStringList(), const QString &pluginPath = QString());
};
}