summaryrefslogtreecommitdiff
path: root/src/protocols/TearingControl.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-05-01 19:40:35 +0100
committerVaxry <vaxry@vaxry.net>2024-05-01 19:40:35 +0100
commit0237e39f74a7facf51d40bc4c95f6ce8ce3cdc2e (patch)
treecbce01b6c5832b02a5b43a862b1953f46143e870 /src/protocols/TearingControl.cpp
parent47b087950dcfaf6fdda63c4d5f13efda3508a6fb (diff)
protocols: utilize hyprwayland-scanner 0.3.3 functions
stuff like ::version(), ::client(), ::error() etc
Diffstat (limited to 'src/protocols/TearingControl.cpp')
-rw-r--r--src/protocols/TearingControl.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/protocols/TearingControl.cpp b/src/protocols/TearingControl.cpp
index 7f0fe744..e0534735 100644
--- a/src/protocols/TearingControl.cpp
+++ b/src/protocols/TearingControl.cpp
@@ -13,21 +13,19 @@ void CTearingControlProtocol::bindManager(wl_client* client, void* data, uint32_
RESOURCE->setOnDestroy([this](CWpTearingControlManagerV1* p) { this->onManagerResourceDestroy(p->resource()); });
RESOURCE->setDestroy([this](CWpTearingControlManagerV1* pMgr) { this->onManagerResourceDestroy(pMgr->resource()); });
- RESOURCE->setGetTearingControl([this](CWpTearingControlManagerV1* pMgr, uint32_t id, wl_resource* surface) {
- this->onGetController(wl_resource_get_client(pMgr->resource()), pMgr->resource(), id, wlr_surface_from_resource(surface));
- });
+ RESOURCE->setGetTearingControl(
+ [this](CWpTearingControlManagerV1* pMgr, uint32_t id, wl_resource* surface) { this->onGetController(pMgr->client(), pMgr, id, wlr_surface_from_resource(surface)); });
}
void CTearingControlProtocol::onManagerResourceDestroy(wl_resource* res) {
std::erase_if(m_vManagers, [&](const auto& other) { return other->resource() == res; });
}
-void CTearingControlProtocol::onGetController(wl_client* client, wl_resource* resource, uint32_t id, wlr_surface* surf) {
- const auto CONTROLLER =
- m_vTearingControllers.emplace_back(std::make_unique<CTearingControl>(std::make_shared<CWpTearingControlV1>(client, wl_resource_get_version(resource), id), surf)).get();
+void CTearingControlProtocol::onGetController(wl_client* client, CWpTearingControlManagerV1* pMgr, uint32_t id, wlr_surface* surf) {
+ const auto CONTROLLER = m_vTearingControllers.emplace_back(std::make_unique<CTearingControl>(std::make_shared<CWpTearingControlV1>(client, pMgr->version(), id), surf)).get();
if (!CONTROLLER->good()) {
- wl_resource_post_no_memory(resource);
+ pMgr->noMemory();
m_vTearingControllers.pop_back();
return;
}