diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp | 19 | ||||
-rw-r--r-- | src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h | 8 |
2 files changed, 6 insertions, 21 deletions
diff --git a/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp b/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp index f0e38a33..3a3e8b00 100644 --- a/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp +++ b/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp @@ -11,31 +11,16 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -bool QWaylandWlShellIntegration::initialize(QWaylandDisplay *display) +QWaylandWlShellIntegration::QWaylandWlShellIntegration() : QWaylandShellIntegrationTemplate(1) { - const auto globals = display->globals(); - for (QWaylandDisplay::RegistryGlobal global : globals) { - if (global.interface == QLatin1String("wl_shell")) { - m_wlShell = new QtWayland::wl_shell(display->wl_registry(), global.id, 1); - break; - } - } - - if (!m_wlShell) { - qCDebug(lcQpaWayland) << "Couldn't find global wl_shell"; - return false; - } - qCWarning(lcQpaWayland) << "\"wl-shell\" is a deprecated shell extension, prefer using" << "\"xdg-shell\" if supported by the compositor" << "by setting the environment variable QT_WAYLAND_SHELL_INTEGRATION"; - - return true; } QWaylandShellSurface *QWaylandWlShellIntegration::createShellSurface(QWaylandWindow *window) { - return new QWaylandWlShellSurface(m_wlShell->get_shell_surface(window->wlSurface()), window); + return new QWaylandWlShellSurface(get_shell_surface(window->wlSurface()), window); } void *QWaylandWlShellIntegration::nativeResourceForWindow(const QByteArray &resource, QWindow *window) diff --git a/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h b/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h index 51dac4bc..fd3cb87f 100644 --- a/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h +++ b/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h @@ -23,16 +23,16 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -class Q_WAYLANDCLIENT_EXPORT QWaylandWlShellIntegration : public QWaylandShellIntegration +class Q_WAYLANDCLIENT_EXPORT QWaylandWlShellIntegration + : public QWaylandShellIntegrationTemplate<QWaylandWlShellIntegration>, + public QtWayland::wl_shell { public: - QWaylandWlShellIntegration() {} - bool initialize(QWaylandDisplay *) override; + QWaylandWlShellIntegration(); QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) override; private: - QtWayland::wl_shell *m_wlShell = nullptr; }; } |