diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.cpp index ddac7d29505..7dcdd6e5997 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.cpp +++ b/src/plugins/platforms/wayland/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/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h index 48cb80c7355..c01af37074a 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h +++ b/src/plugins/platforms/wayland/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, + public QtWayland::zwp_fullscreen_shell_v1 { public: - bool initialize(QWaylandDisplay *display) override; + QWaylandFullScreenShellV1Integration(); + ~QWaylandFullScreenShellV1Integration() override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; - -private: - QScopedPointer m_shell; }; } // namespace QtWaylandClient