From 8dd88d901d3799ed9f2f4b3babcd0b2c1a7c5a24 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 3 Aug 2022 16:05:25 +0200 Subject: [PATCH] guard onDisconnect --- src/helpers/Monitor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 9e7f76c4..b01ccb14 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -3,6 +3,9 @@ #include "../Compositor.hpp" void CMonitor::onConnect(bool noRule) { + if (m_bEnabled) + return; + // get monitor rule that matches SMonitorRule monitorRule = g_pConfigManager->getMonitorRuleFor(output->name); @@ -109,6 +112,10 @@ void CMonitor::onConnect(bool noRule) { } void CMonitor::onDisconnect() { + + if (!m_bEnabled) + return; + // Cleanup everything. Move windows back, snap cursor, shit. CMonitor* BACKUPMON = nullptr; for (auto& m : g_pCompositor->m_vMonitors) {