summaryrefslogtreecommitdiff
path: root/src/protocols
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2025-07-10 12:55:00 +0200
committerVaxry <43317083+vaxerski@users.noreply.github.com>2025-07-10 14:09:00 +0200
commit87653077f8b918b3b234d9c9092bc4c723e7bd4b (patch)
tree884f2d9ab50b202af7b3632cf102506d8974b064 /src/protocols
parenta21882be33f3debe27e327c6b125e17ad438f90e (diff)
cursorshape: use unique ptrs
less refcounting.
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/CursorShape.cpp6
-rw-r--r--src/protocols/CursorShape.hpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/protocols/CursorShape.cpp b/src/protocols/CursorShape.cpp
index 26f79a86..89ab7142 100644
--- a/src/protocols/CursorShape.cpp
+++ b/src/protocols/CursorShape.cpp
@@ -32,8 +32,8 @@ void CCursorShapeProtocol::onGetTabletToolV2(CWpCursorShapeManagerV1* pMgr, uint
}
void CCursorShapeProtocol::createCursorShapeDevice(CWpCursorShapeManagerV1* pMgr, uint32_t id, wl_resource* resource) {
- const auto CLIENT = pMgr->client();
- const auto RESOURCE = m_devices.emplace_back(makeShared<CWpCursorShapeDeviceV1>(CLIENT, pMgr->version(), id));
+ const auto CLIENT = pMgr->client();
+ const auto& RESOURCE = m_devices.emplace_back(makeUnique<CWpCursorShapeDeviceV1>(CLIENT, pMgr->version(), id));
RESOURCE->setOnDestroy([this](CWpCursorShapeDeviceV1* p) { this->onDeviceResourceDestroy(p->resource()); });
RESOURCE->setDestroy([this](CWpCursorShapeDeviceV1* p) { this->onDeviceResourceDestroy(p->resource()); });
@@ -52,4 +52,4 @@ void CCursorShapeProtocol::onSetShape(CWpCursorShapeDeviceV1* pMgr, uint32_t ser
event.shapeName = CURSOR_SHAPE_NAMES.at(shape);
m_events.setShape.emit(event);
-} \ No newline at end of file
+}
diff --git a/src/protocols/CursorShape.hpp b/src/protocols/CursorShape.hpp
index 918032ab..d4a130e9 100644
--- a/src/protocols/CursorShape.hpp
+++ b/src/protocols/CursorShape.hpp
@@ -32,7 +32,7 @@ class CCursorShapeProtocol : public IWaylandProtocol {
void createCursorShapeDevice(CWpCursorShapeManagerV1* pMgr, uint32_t id, wl_resource* resource);
//
- std::vector<SP<CWpCursorShapeDeviceV1>> m_devices;
+ std::vector<UP<CWpCursorShapeDeviceV1>> m_devices;
std::vector<UP<CWpCursorShapeManagerV1>> m_managers;
};