From 1a0ed00f74f7cfcc3b7c4fd7e3bf0073c4973267 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Mon, 18 Aug 2025 17:42:19 +0200 Subject: protocols/wayland: use UP and rvalue refs for callbacks (#11471) use UP and rvalue refs in CWLCallbackResource and m_callbacks. --- src/protocols/core/Compositor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/protocols/core/Compositor.cpp') diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index 37e2df9a..73326990 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -27,7 +27,7 @@ class CDefaultSurfaceRole : public ISurfaceRole { } }; -CWLCallbackResource::CWLCallbackResource(SP resource_) : m_resource(resource_) { +CWLCallbackResource::CWLCallbackResource(UP&& resource_) : m_resource(std::move(resource_)) { ; } @@ -239,7 +239,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP resource_) : m_resource(re m_pending.opaque = RG->m_region; }); - m_resource->setFrame([this](CWlSurface* r, uint32_t id) { m_callbacks.emplace_back(makeShared(makeShared(m_client, 1, id))); }); + m_resource->setFrame([this](CWlSurface* r, uint32_t id) { m_callbacks.emplace_back(makeUnique(makeUnique(m_client, 1, id))); }); m_resource->setOffset([this](CWlSurface* r, int32_t x, int32_t y) { m_pending.updated.bits.offset = true; -- cgit v1.2.3