mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 06:31:57 -07:00
cursorshape: use unique ptrs
less refcounting.
This commit is contained in:
@@ -32,8 +32,8 @@ void CCursorShapeProtocol::onGetTabletToolV2(CWpCursorShapeManagerV1* pMgr, uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CCursorShapeProtocol::createCursorShapeDevice(CWpCursorShapeManagerV1* pMgr, uint32_t id, wl_resource* resource) {
|
void CCursorShapeProtocol::createCursorShapeDevice(CWpCursorShapeManagerV1* pMgr, uint32_t id, wl_resource* resource) {
|
||||||
const auto CLIENT = pMgr->client();
|
const auto CLIENT = pMgr->client();
|
||||||
const auto RESOURCE = m_devices.emplace_back(makeShared<CWpCursorShapeDeviceV1>(CLIENT, pMgr->version(), id));
|
const auto& RESOURCE = m_devices.emplace_back(makeUnique<CWpCursorShapeDeviceV1>(CLIENT, pMgr->version(), id));
|
||||||
RESOURCE->setOnDestroy([this](CWpCursorShapeDeviceV1* p) { this->onDeviceResourceDestroy(p->resource()); });
|
RESOURCE->setOnDestroy([this](CWpCursorShapeDeviceV1* p) { this->onDeviceResourceDestroy(p->resource()); });
|
||||||
|
|
||||||
RESOURCE->setDestroy([this](CWpCursorShapeDeviceV1* p) { this->onDeviceResourceDestroy(p->resource()); });
|
RESOURCE->setDestroy([this](CWpCursorShapeDeviceV1* p) { this->onDeviceResourceDestroy(p->resource()); });
|
||||||
|
@@ -32,7 +32,7 @@ class CCursorShapeProtocol : public IWaylandProtocol {
|
|||||||
void createCursorShapeDevice(CWpCursorShapeManagerV1* pMgr, uint32_t id, wl_resource* resource);
|
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;
|
std::vector<UP<CWpCursorShapeManagerV1>> m_managers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user