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/GammaControl.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/protocols/GammaControl.cpp') diff --git a/src/protocols/GammaControl.cpp b/src/protocols/GammaControl.cpp index b0f9af7a..356fd88d 100644 --- a/src/protocols/GammaControl.cpp +++ b/src/protocols/GammaControl.cpp @@ -70,7 +70,7 @@ CGammaControl::CGammaControl(SP resource_, wl_resource* out close(fd); if ((size_t)readBytes != gammaTable.size() * sizeof(uint16_t)) { - wl_resource_post_error(gamma->resource(), ZWLR_GAMMA_CONTROL_V1_ERROR_INVALID_GAMMA, "Gamma ramps size mismatch"); + gamma->error(ZWLR_GAMMA_CONTROL_V1_ERROR_INVALID_GAMMA, "Gamma ramps size mismatch"); return; } @@ -156,13 +156,11 @@ void CGammaControlProtocol::destroyGammaControl(CGammaControl* gamma) { } void CGammaControlProtocol::onGetGammaControl(CZwlrGammaControlManagerV1* pMgr, uint32_t id, wl_resource* output) { - const auto CLIENT = wl_resource_get_client(pMgr->resource()); - const auto RESOURCE = - m_vGammaControllers.emplace_back(std::make_unique(std::make_shared(CLIENT, wl_resource_get_version(pMgr->resource()), id), output)) - .get(); + const auto CLIENT = pMgr->client(); + const auto RESOURCE = m_vGammaControllers.emplace_back(std::make_unique(std::make_shared(CLIENT, pMgr->version(), id), output)).get(); if (!RESOURCE->good()) { - wl_resource_post_no_memory(pMgr->resource()); + pMgr->noMemory(); m_vGammaControllers.pop_back(); return; } -- cgit v1.2.3