From 74d05d0adc14d920aa780b2ca2a51c9ca14fadd7 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 28 Oct 2022 23:48:48 +0100 Subject: ensure VRR for current display only in onConnect --- src/config/ConfigManager.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index bad134b1..d3b6e507 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1553,10 +1553,10 @@ void CConfigManager::ensureDPMS() { } } -void CConfigManager::ensureVRR() { +void CConfigManager::ensureVRR(CMonitor* pMonitor) { static auto *const PNOVRR = &getConfigValuePtr("misc:no_vfr")->intValue; - - for (auto& m : g_pCompositor->m_vMonitors) { + + auto ensureVRRForDisplay = [&](CMonitor* m) -> void { if (!*PNOVRR && !m->vrrActive) { // Adaptive sync (VRR) wlr_output_enable_adaptive_sync(m->output, 1); @@ -1584,6 +1584,15 @@ void CConfigManager::ensureVRR() { Debug::log(LOG, "VRR ensured on %s -> false", m->output->name); } + }; + + if (pMonitor) { + ensureVRRForDisplay(pMonitor); + return; + } + + for (auto& m : g_pCompositor->m_vMonitors) { + ensureVRRForDisplay(m.get()); } } -- cgit v1.2.3