mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-24 00:09:48 +01:00
xdgoutput: do not destroy resources on monitorRemoved
This commit is contained in:
parent
4ddcda93f5
commit
db48f973fd
1 changed files with 6 additions and 1 deletions
|
@ -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("configReloaded", [this](void* self, std::any param) { this->updateAllOutputs(); });
|
||||||
g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, std::any param) {
|
g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, std::any param) {
|
||||||
const auto PMONITOR = std::any_cast<CMonitor*>(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;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue