diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-05-01 19:40:35 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-05-01 19:40:35 +0100 |
| commit | 0237e39f74a7facf51d40bc4c95f6ce8ce3cdc2e (patch) | |
| tree | cbce01b6c5832b02a5b43a862b1953f46143e870 /src/protocols/PointerConstraints.cpp | |
| parent | 47b087950dcfaf6fdda63c4d5f13efda3508a6fb (diff) | |
protocols: utilize hyprwayland-scanner 0.3.3 functions
stuff like ::version(), ::client(), ::error() etc
Diffstat (limited to 'src/protocols/PointerConstraints.cpp')
| -rw-r--r-- | src/protocols/PointerConstraints.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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<CPointerConstraint> 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<CPointerConstraint> 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<CPointerConstraint> 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<CPointerConstraint>( - std::make_shared<CZwpLockedPointerV1>(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<CPointerConstraint>(std::make_shared<CZwpLockedPointerV1>(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<CPointerConstraint>( - std::make_shared<CZwpConfinedPointerV1>(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<CPointerConstraint>(std::make_shared<CZwpConfinedPointerV1>(CLIENT, pMgr->version(), id), wlr_surface_from_resource(surface), region, lifetime)); onNewConstraint(RESOURCE, pMgr); } |
