summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddisplay.cpp
diff options
context:
space:
mode:
authorDavid Redondo <qt@david-redondo.de>2024-03-07 15:18:40 +0100
committerDavid Redondo <qt@david-redondo.de>2024-05-10 08:57:33 +0200
commitde2c3b3f85698d210ccfdb4b1e65e1c397a1cd3a (patch)
tree08b60b33367f0a4df03bc53e1ff9aab6d32c6a0c /src/client/qwaylanddisplay.cpp
parenta5bea434aa9137f9b0ba6170fbb5a237e890b021 (diff)
client: Disentangle platform services and windowmanagerintegration
The current state was a bit messy with the platform services being the potentially no initialised qt window manager extension wayland object. Change-Id: Id1f911b75d34fcf70594ca7257b79bf431f0643f Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r--src/client/qwaylanddisplay.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 265f0bb3f..9bd60e741 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -312,7 +312,7 @@ QWaylandClientBufferIntegration * QWaylandDisplay::clientBufferIntegration() con
QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() const
{
- return mWindowManagerIntegration.data();
+ return mGlobals.windowManagerIntegration.get();
}
QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
@@ -335,8 +335,6 @@ void QWaylandDisplay::setupConnection()
struct ::wl_registry *registry = wl_display_get_registry(mDisplay);
init(registry);
- mWindowManagerIntegration.reset(new QWaylandWindowManagerIntegration(this));
-
#if QT_CONFIG(xkbcommon)
mXkbContext.reset(xkb_context_new(XKB_CONTEXT_NO_FLAGS));
if (!mXkbContext)
@@ -373,7 +371,6 @@ QWaylandDisplay::~QWaylandDisplay(void)
// Reset the globals manually since they need to be destroyed before the wl_display
mGlobals = {};
- mWindowManagerIntegration.reset();
if (object())
wl_registry_destroy(object());
@@ -781,6 +778,9 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
mGlobals.xdgToplevelDragManager.reset(
new WithDestructor<QtWayland::xdg_toplevel_drag_manager_v1,
xdg_toplevel_drag_manager_v1_destroy>(registry, id, 1));
+ } else if (interface == QLatin1String(QtWayland::qt_windowmanager::interface()->name)) {
+ mGlobals.windowManagerIntegration.reset(
+ new QWaylandWindowManagerIntegration(this, id, version));
}
mRegistryGlobals.append(RegistryGlobal(id, interface, version, registry));