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.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index dd2db9aa..ac4435b2 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -21,6 +21,17 @@ void CMonitor::onConnect(bool noRule) {
return;
}
+ if (!m_pThisWrap) {
+
+ // find the wrap
+ for (auto& m : g_pCompositor->m_vRealMonitors) {
+ if (m->ID == ID) {
+ m_pThisWrap = &m;
+ break;
+ }
+ }
+ }
+
if (std::find_if(g_pCompositor->m_vMonitors.begin(), g_pCompositor->m_vMonitors.end(), [&](auto& other) { return other.get() == this; }) == g_pCompositor->m_vMonitors.end()){
g_pCompositor->m_vMonitors.push_back(*m_pThisWrap);
}
@@ -98,6 +109,8 @@ void CMonitor::onConnect(bool noRule) {
activeWorkspace = PNEWWORKSPACE->m_iID;
scale = monitorRule.scale;
+ m_pThisWrap = nullptr;
+
forceFullFrames = 3; // force 3 full frames to make sure there is no blinking due to double-buffering.
g_pCompositor->deactivateAllWLRWorkspaces(PNEWWORKSPACE->m_pWlrHandle);