mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 07:10:02 +01:00
monitor: remove monitor from list on disconnect before unsafestate (#12544)
This commit is contained in:
parent
6712fb954f
commit
f58c80fd39
1 changed files with 2 additions and 2 deletions
|
|
@ -411,6 +411,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
||||||
m_layerSurfaceLayers[i].clear();
|
m_layerSurfaceLayers[i].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::erase_if(g_pCompositor->m_monitors, [&](PHLMONITOR& el) { return el.get() == this; });
|
||||||
Debug::log(LOG, "Removed monitor {}!", m_name);
|
Debug::log(LOG, "Removed monitor {}!", m_name);
|
||||||
|
|
||||||
if (!BACKUPMON) {
|
if (!BACKUPMON) {
|
||||||
|
|
@ -462,7 +463,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
||||||
PHLMONITOR pMonitorMostHz = nullptr;
|
PHLMONITOR pMonitorMostHz = nullptr;
|
||||||
|
|
||||||
for (auto const& m : g_pCompositor->m_monitors) {
|
for (auto const& m : g_pCompositor->m_monitors) {
|
||||||
if (m->m_refreshRate > mostHz && m != m_self) {
|
if (m->m_refreshRate > mostHz) {
|
||||||
pMonitorMostHz = m;
|
pMonitorMostHz = m;
|
||||||
mostHz = m->m_refreshRate;
|
mostHz = m->m_refreshRate;
|
||||||
}
|
}
|
||||||
|
|
@ -470,7 +471,6 @@ void CMonitor::onDisconnect(bool destroy) {
|
||||||
|
|
||||||
g_pHyprRenderer->m_mostHzMonitor = pMonitorMostHz;
|
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) {
|
void CMonitor::applyCMType(NCMType::eCMType cmType, int cmSdrEotf) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue