diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-09-05 13:33:04 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-09-05 13:33:08 +0200 |
| commit | db48f973fd436a38dfd5ed63991610bb90b30bc9 (patch) | |
| tree | 5d38c5b3b566230d33113ca09b61b725ae8c30ea /src/protocols/XDGOutput.cpp | |
| parent | 4ddcda93f5887792a953332bf1b487e4b2c3b4ed (diff) | |
xdgoutput: do not destroy resources on monitorRemoved
Diffstat (limited to 'src/protocols/XDGOutput.cpp')
| -rw-r--r-- | src/protocols/XDGOutput.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/protocols/XDGOutput.cpp b/src/protocols/XDGOutput.cpp index 4a7278d4..94839e20 100644 --- a/src/protocols/XDGOutput.cpp +++ b/src/protocols/XDGOutput.cpp @@ -62,7 +62,12 @@ CXDGOutputProtocol::CXDGOutputProtocol(const wl_interface* iface, const int& ver 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<CMonitor*>(param); - std::erase_if(m_vXDGOutputs, [&](const auto& other) { return other->monitor == PMONITOR; }); + std::erase_if(m_vXDGOutputs, [&](const auto& other) { + const auto REMOVE = other->monitor == PMONITOR; + if (REMOVE) + other->resource->markDefunct(); // so that wl_resource_destroy is not sent + return REMOVE; + }); }); } |
