mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 18:29:50 +01:00
move setActiveMonitor backup later in onDisconnect
This commit is contained in:
parent
41cdfb7420
commit
e9bd2ee996
1 changed files with 3 additions and 3 deletions
|
@ -173,9 +173,6 @@ void CMonitor::onDisconnect() {
|
|||
}
|
||||
}
|
||||
|
||||
if (g_pCompositor->m_pLastMonitor == this)
|
||||
g_pCompositor->setActiveMonitor(BACKUPMON);
|
||||
|
||||
// remove mirror
|
||||
if (pMirrorOf) {
|
||||
pMirrorOf->mirrors.erase(std::find_if(pMirrorOf->mirrors.begin(), pMirrorOf->mirrors.end(), [&](const auto& other) { return other == this; }));
|
||||
|
@ -239,6 +236,9 @@ void CMonitor::onDisconnect() {
|
|||
|
||||
g_pEventManager->postEvent(SHyprIPCEvent{"monitorremoved", szName});
|
||||
|
||||
if (g_pCompositor->m_pLastMonitor == this)
|
||||
g_pCompositor->setActiveMonitor(BACKUPMON);
|
||||
|
||||
std::erase_if(g_pCompositor->m_vMonitors, [&](std::shared_ptr<CMonitor>& el) { return el.get() == this; });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue