summaryrefslogtreecommitdiffstats
path: root/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp')
-rw-r--r--src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp b/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp
index f0e38a331..2e2076b0a 100644
--- a/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp
+++ b/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp
@@ -11,31 +11,22 @@ 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;
+QWaylandWlShellIntegration::~QWaylandWlShellIntegration()
+{
+ if (object())
+ wl_shell_destroy(object());
}
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)