mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-02-04 11:55:42 +00:00
monitor: remove monitor from list on disconnect before unsafestate (#12544)
This commit is contained in:
@ -411,6 +411,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
||||
m_layerSurfaceLayers[i].clear();
|
||||
}
|
||||
|
||||
std::erase_if(g_pCompositor->m_monitors, [&](PHLMONITOR& el) { return el.get() == this; });
|
||||
Debug::log(LOG, "Removed monitor {}!", m_name);
|
||||
|
||||
if (!BACKUPMON) {
|
||||
@ -462,7 +463,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
||||
PHLMONITOR pMonitorMostHz = nullptr;
|
||||
|
||||
for (auto const& m : g_pCompositor->m_monitors) {
|
||||
if (m->m_refreshRate > mostHz && m != m_self) {
|
||||
if (m->m_refreshRate > mostHz) {
|
||||
pMonitorMostHz = m;
|
||||
mostHz = m->m_refreshRate;
|
||||
}
|
||||
@ -470,7 +471,6 @@ void CMonitor::onDisconnect(bool destroy) {
|
||||
|
||||
g_pHyprRenderer->m_mostHzMonitor = pMonitorMostHz;
|
||||
}
|
||||
std::erase_if(g_pCompositor->m_monitors, [&](PHLMONITOR& el) { return el.get() == this; });
|
||||
}
|
||||
|
||||
void CMonitor::applyCMType(NCMType::eCMType cmType, int cmSdrEotf) {
|
||||
|
||||
Reference in New Issue
Block a user