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/GammaControl.cpp | |
| parent | 47b087950dcfaf6fdda63c4d5f13efda3508a6fb (diff) | |
protocols: utilize hyprwayland-scanner 0.3.3 functions
stuff like ::version(), ::client(), ::error() etc
Diffstat (limited to 'src/protocols/GammaControl.cpp')
| -rw-r--r-- | src/protocols/GammaControl.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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<CZwlrGammaControlV1> 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<CGammaControl>(std::make_shared<CZwlrGammaControlV1>(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<CGammaControl>(std::make_shared<CZwlrGammaControlV1>(CLIENT, pMgr->version(), id), output)).get(); if (!RESOURCE->good()) { - wl_resource_post_no_memory(pMgr->resource()); + pMgr->noMemory(); m_vGammaControllers.pop_back(); return; } |
