summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Monitor.cpp')
-rw-r--r--src/helpers/Monitor.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 76150f9b..cae53904 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -130,16 +130,16 @@ void CMonitor::onConnect(bool noRule) {
forceFullFrames = 3; // force 3 full frames to make sure there is no blinking due to double-buffering.
//
+ g_pEventManager->postEvent(SHyprIPCEvent{"monitoradded", szName});
+
if (!g_pCompositor->m_pLastMonitor) // set the last monitor if it isnt set yet
- g_pCompositor->m_pLastMonitor = this;
+ g_pCompositor->setActiveMonitor(this);
wlr_xcursor_manager_load(g_pCompositor->m_sWLRXCursorMgr, scale);
g_pHyprRenderer->arrangeLayersForMonitor(ID);
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(ID);
- g_pEventManager->postEvent(SHyprIPCEvent{"monitoradded", szName});
-
// ensure VRR (will enable if necessary)
g_pConfigManager->ensureVRR(this);
}
@@ -161,7 +161,7 @@ void CMonitor::onDisconnect() {
}
if (g_pCompositor->m_pLastMonitor == this)
- g_pCompositor->m_pLastMonitor = BACKUPMON;
+ g_pCompositor->setActiveMonitor(BACKUPMON);
// remove mirror
if (pMirrorOf) {
@@ -365,6 +365,6 @@ void CMonitor::setMirror(const std::string& mirrorOf) {
g_pCompositor->m_vMonitors.erase(std::remove_if(g_pCompositor->m_vMonitors.begin(), g_pCompositor->m_vMonitors.end(), [&](const auto& other) { return other.get() == this; }));
}
- g_pCompositor->m_pLastMonitor = g_pCompositor->m_vMonitors.front().get();
+ g_pCompositor->setActiveMonitor(g_pCompositor->m_vMonitors.front().get());
}
}