diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-03 17:42:19 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-03 17:42:19 +0200 |
| commit | 37068cf4f0e29313106886478dbf58872407a626 (patch) | |
| tree | 6aa91c4e3dc66a9d76b7fc293b7b858265cf4316 /src/helpers/Monitor.cpp | |
| parent | 587330d864925e63f41c15a5cef5d4d6c3a5b6c4 (diff) | |
fix crash with reenabling a monitor
Diffstat (limited to 'src/helpers/Monitor.cpp')
| -rw-r--r-- | src/helpers/Monitor.cpp | 13 |
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); |
