mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 13:25:58 +01:00
verify lastmon status on connect
This commit is contained in:
parent
111d209bff
commit
f8a6799d4e
1 changed files with 12 additions and 0 deletions
|
@ -142,6 +142,18 @@ void CMonitor::onConnect(bool noRule) {
|
||||||
|
|
||||||
// ensure VRR (will enable if necessary)
|
// ensure VRR (will enable if necessary)
|
||||||
g_pConfigManager->ensureVRR(this);
|
g_pConfigManager->ensureVRR(this);
|
||||||
|
|
||||||
|
// verify last mon valid
|
||||||
|
bool found = false;
|
||||||
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
|
if (m.get() == g_pCompositor->m_pLastMonitor) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
g_pCompositor->setActiveMonitor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMonitor::onDisconnect() {
|
void CMonitor::onDisconnect() {
|
||||||
|
|
Loading…
Reference in a new issue