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/ShortcutsInhibit.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/protocols/ShortcutsInhibit.cpp') diff --git a/src/protocols/ShortcutsInhibit.cpp b/src/protocols/ShortcutsInhibit.cpp index 30bc4dc2..ffc74b53 100644 --- a/src/protocols/ShortcutsInhibit.cpp +++ b/src/protocols/ShortcutsInhibit.cpp @@ -47,23 +47,21 @@ void CKeyboardShortcutsInhibitProtocol::destroyInhibitor(CKeyboardShortcutsInhib void CKeyboardShortcutsInhibitProtocol::onInhibit(CZwpKeyboardShortcutsInhibitManagerV1* pMgr, uint32_t id, wl_resource* surface, wl_resource* seat) { wlr_surface* surf = wlr_surface_from_resource(surface); - const auto CLIENT = wl_resource_get_client(pMgr->resource()); + const auto CLIENT = pMgr->client(); for (auto& in : m_vInhibitors) { if (in->surface() != surf) continue; - wl_resource_post_error(pMgr->resource(), ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ALREADY_INHIBITED, "Already inhibited for surface resource"); + pMgr->error(ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ALREADY_INHIBITED, "Already inhibited for surface resource"); return; } - const auto RESOURCE = m_vInhibitors - .emplace_back(std::make_unique( - std::make_shared(CLIENT, wl_resource_get_version(pMgr->resource()), id), surf)) - .get(); + const auto RESOURCE = + m_vInhibitors.emplace_back(std::make_unique(std::make_shared(CLIENT, pMgr->version(), id), surf)).get(); if (!RESOURCE->good()) { - wl_resource_post_no_memory(pMgr->resource()); + pMgr->noMemory(); m_vInhibitors.pop_back(); LOGM(ERR, "Failed to create an inhibitor resource"); return; -- cgit v1.2.3