internal: Unsafe state reworks (#3114)
This commit is contained in:
parent
774a5bedf8
commit
d9292800a2
6 changed files with 52 additions and 59 deletions
|
|
@ -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<CMonitor*>(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; });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue