From 0237e39f74a7facf51d40bc4c95f6ce8ce3cdc2e Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 1 May 2024 19:40:35 +0100 Subject: protocols: utilize hyprwayland-scanner 0.3.3 functions stuff like ::version(), ::client(), ::error() etc --- src/protocols/PointerConstraints.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/protocols/PointerConstraints.cpp') diff --git a/src/protocols/PointerConstraints.cpp b/src/protocols/PointerConstraints.cpp index ea7f4654..bcc515eb 100644 --- a/src/protocols/PointerConstraints.cpp +++ b/src/protocols/PointerConstraints.cpp @@ -216,7 +216,7 @@ void CPointerConstraintsProtocol::destroyPointerConstraint(CPointerConstraint* h void CPointerConstraintsProtocol::onNewConstraint(SP constraint, CZwpPointerConstraintsV1* pMgr) { if (!constraint->good()) { LOGM(ERR, "Couldn't create constraint??"); - wl_resource_post_no_memory(pMgr->resource()); + pMgr->noMemory(); m_vConstraints.pop_back(); return; } @@ -232,7 +232,7 @@ void CPointerConstraintsProtocol::onNewConstraint(SP constra if (DUPES > 1) { LOGM(ERR, "Constraint for surface duped"); - wl_resource_post_error(pMgr->resource(), ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED, "Surface already confined"); + pMgr->error(ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED, "Surface already confined"); m_vConstraints.pop_back(); return; } @@ -244,18 +244,18 @@ void CPointerConstraintsProtocol::onNewConstraint(SP constra void CPointerConstraintsProtocol::onLockPointer(CZwpPointerConstraintsV1* pMgr, uint32_t id, wl_resource* surface, wl_resource* pointer, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime) { - const auto CLIENT = wl_resource_get_client(pMgr->resource()); - const auto RESOURCE = m_vConstraints.emplace_back(std::make_shared( - std::make_shared(CLIENT, wl_resource_get_version(pMgr->resource()), id), wlr_surface_from_resource(surface), region, lifetime)); + const auto CLIENT = pMgr->client(); + const auto RESOURCE = m_vConstraints.emplace_back( + std::make_shared(std::make_shared(CLIENT, pMgr->version(), id), wlr_surface_from_resource(surface), region, lifetime)); onNewConstraint(RESOURCE, pMgr); } void CPointerConstraintsProtocol::onConfinePointer(CZwpPointerConstraintsV1* pMgr, uint32_t id, wl_resource* surface, wl_resource* pointer, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime) { - const auto CLIENT = wl_resource_get_client(pMgr->resource()); - const auto RESOURCE = m_vConstraints.emplace_back(std::make_shared( - std::make_shared(CLIENT, wl_resource_get_version(pMgr->resource()), id), wlr_surface_from_resource(surface), region, lifetime)); + const auto CLIENT = pMgr->client(); + const auto RESOURCE = m_vConstraints.emplace_back( + std::make_shared(std::make_shared(CLIENT, pMgr->version(), id), wlr_surface_from_resource(surface), region, lifetime)); onNewConstraint(RESOURCE, pMgr); } -- cgit v1.2.3