From d9292800a27ca7de5cb8b258651e535a7880e9e6 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Fri, 1 Sep 2023 22:03:56 +0200 Subject: internal: Unsafe state reworks (#3114) --- src/protocols/XDGOutput.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/protocols/XDGOutput.cpp') diff --git a/src/protocols/XDGOutput.cpp b/src/protocols/XDGOutput.cpp index c1049bb5..4a7278d4 100644 --- a/src/protocols/XDGOutput.cpp +++ b/src/protocols/XDGOutput.cpp @@ -58,16 +58,11 @@ void CXDGOutputProtocol::bindManager(wl_client* client, void* data, uint32_t ver } CXDGOutputProtocol::CXDGOutputProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) { - g_pHookSystem->hookDynamic("monitorLayoutChanged", [&](void* self, std::any param) { this->updateAllOutputs(); }); - g_pHookSystem->hookDynamic("configReloaded", [&](void* self, std::any param) { this->updateAllOutputs(); }); - g_pHookSystem->hookDynamic("monitorRemoved", [&](void* self, std::any param) { + g_pHookSystem->hookDynamic("monitorLayoutChanged", [this](void* self, std::any param) { this->updateAllOutputs(); }); + g_pHookSystem->hookDynamic("configReloaded", [this](void* self, std::any param) { this->updateAllOutputs(); }); + g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, std::any param) { const auto PMONITOR = std::any_cast(param); - std::erase_if(m_vXDGOutputs, [&](const auto& other) { - const bool R = other->monitor == PMONITOR; - if (R) - other->resource->markDefunct(); - return R; - }); + std::erase_if(m_vXDGOutputs, [&](const auto& other) { return other->monitor == PMONITOR; }); }); } -- cgit v1.2.3