diff options
author | David Redondo <qt@david-redondo.de> | 2023-02-22 14:33:22 +0100 |
---|---|---|
committer | David Edmundson <davidedmundson@kde.org> | 2023-03-01 10:06:27 +0000 |
commit | ee92c05f34e96431e22b5735d3b864d08e2e4ad3 (patch) | |
tree | f22ccf70a8fb645b3e1ba4e7d2b5a600cc877e12 /src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | |
parent | 801b217e06628b3bc8fc543798652c6267be549d (diff) | |
download | qtwayland-ee92c05f34e96431e22b5735d3b864d08e2e4ad3.tar.gz |
Port xdg shell plugin towards QWaylandShellIntegrationTemplate
Ports manual initialization to the automatic handling of the
template. For now the integration QWaylandXdgShellIntegration
and QWaylandXdgShell are still separate but could be merged
in a future step.
Change-Id: I73bb9674e62f24f403349784e1b1e52a39aa8e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp')
-rw-r--r-- | src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index 6303fbc9..ee53341a 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -444,7 +444,7 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) { Q_ASSERT(!m_toplevel && !m_popup); - auto positioner = new QtWayland::xdg_positioner(m_shell->create_positioner()); + auto positioner = new QtWayland::xdg_positioner(m_shell->m_xdgWmBase->create_positioner()); // set_popup expects a position relative to the parent QRect windowGeometry = m_window->windowContentGeometry(); QMargins windowMargins = m_window->windowContentMargins() - m_window->clientSideMargins(); @@ -615,9 +615,8 @@ QString QWaylandXdgSurface::externWindowHandle() return m_toplevel->m_exported->handle(); } -QWaylandXdgShell::QWaylandXdgShell(QWaylandDisplay *display, uint32_t id, uint32_t availableVersion) - : QtWayland::xdg_wm_base(display->wl_registry(), id, qMin(availableVersion, 4u)) - , m_display(display) +QWaylandXdgShell::QWaylandXdgShell(QWaylandDisplay *display, QtWayland::xdg_wm_base *xdgWmBase) + : m_display(display), m_xdgWmBase(xdgWmBase) { display->addRegistryListener(&QWaylandXdgShell::handleRegistryGlobal, this); } @@ -625,17 +624,6 @@ QWaylandXdgShell::QWaylandXdgShell(QWaylandDisplay *display, uint32_t id, uint32 QWaylandXdgShell::~QWaylandXdgShell() { m_display->removeListener(&QWaylandXdgShell::handleRegistryGlobal, this); - destroy(); -} - -QWaylandXdgSurface *QWaylandXdgShell::getXdgSurface(QWaylandWindow *window) -{ - return new QWaylandXdgSurface(this, get_xdg_surface(window->wlSurface()), window); -} - -void QWaylandXdgShell::xdg_wm_base_ping(uint32_t serial) -{ - pong(serial); } void QWaylandXdgShell::handleRegistryGlobal(void *data, wl_registry *registry, uint id, |