summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Redondo <qt@david-redondo.de>2023-02-23 10:21:53 +0100
committerDavid Redondo <qt@david-redondo.de>2023-03-01 11:06:17 +0100
commite3306460dbe7d8ca2cbdacde11c1883b56d29b72 (patch)
treedde80cb7c7dae32d620c14c09617a896b2959da7 /src
parentae026d6ac7b7910b9f3934a1df2b69d3fce344bc (diff)
downloadqtwayland-e3306460dbe7d8ca2cbdacde11c1883b56d29b72.tar.gz
Port fullscreenshell integration to QWaylandShellIntegrationTemplate
Change-Id: Ia3271a312d857d7e864444ad77e8e18a4a3858bf Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.cpp24
-rw-r--r--src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h10
2 files changed, 14 insertions, 20 deletions
diff --git a/src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.cpp b/src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.cpp
index ddac7d29..7dcdd6e5 100644
--- a/src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.cpp
+++ b/src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.cpp
@@ -8,26 +8,20 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
-bool QWaylandFullScreenShellV1Integration::initialize(QWaylandDisplay *display)
+QWaylandFullScreenShellV1Integration::QWaylandFullScreenShellV1Integration()
+ : QWaylandShellIntegrationTemplate(1)
{
- for (const QWaylandDisplay::RegistryGlobal &global : display->globals()) {
- if (global.interface == QLatin1String("zwp_fullscreen_shell_v1") && !m_shell) {
- m_shell.reset(new QtWayland::zwp_fullscreen_shell_v1(display->wl_registry(), global.id, global.version));
- break;
- }
- }
-
- if (!m_shell) {
- qCDebug(lcQpaWayland) << "Couldn't find global zwp_fullscreen_shell_v1 for fullscreen-shell";
- return false;
- }
-
- return true;
+}
+
+QWaylandFullScreenShellV1Integration::~QWaylandFullScreenShellV1Integration()
+{
+ if (isActive())
+ release();
}
QWaylandShellSurface *QWaylandFullScreenShellV1Integration::createShellSurface(QWaylandWindow *window)
{
- return new QWaylandFullScreenShellV1Surface(m_shell.data(), window);
+ return new QWaylandFullScreenShellV1Surface(this, window);
}
} // namespace QtWaylandClient
diff --git a/src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h b/src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h
index 48cb80c7..c01af370 100644
--- a/src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h
+++ b/src/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h
@@ -14,14 +14,14 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
-class Q_WAYLANDCLIENT_EXPORT QWaylandFullScreenShellV1Integration : public QWaylandShellIntegration
+class Q_WAYLANDCLIENT_EXPORT QWaylandFullScreenShellV1Integration
+ : public QWaylandShellIntegrationTemplate<QWaylandFullScreenShellV1Integration>,
+ public QtWayland::zwp_fullscreen_shell_v1
{
public:
- bool initialize(QWaylandDisplay *display) override;
+ QWaylandFullScreenShellV1Integration();
+ ~QWaylandFullScreenShellV1Integration() override;
QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override;
-
-private:
- QScopedPointer<QtWayland::zwp_fullscreen_shell_v1> m_shell;
};
} // namespace QtWaylandClient