From 230356012be03412db78a9e85c711ec878fd0a69 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:48:44 +0100 Subject: [PATCH] renderer: extract solitary check into frame handler --- src/events/Monitors.cpp | 4 +++- src/render/Renderer.cpp | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index 82577dae..8619ade3 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -149,9 +149,11 @@ void Events::listener_monitorFrame(void* owner, void* data) { if (!PMONITOR->m_bEnabled) return; + g_pHyprRenderer->recheckSolitaryForMonitor(PMONITOR); + PMONITOR->tearingState.busy = false; - if (PMONITOR->tearingState.activelyTearing) { + if (PMONITOR->tearingState.activelyTearing && PMONITOR->solitaryClient /* can be invalidated by a recheck */) { if (!PMONITOR->tearingState.frameScheduledWhileBusy) return; // we did not schedule a frame yet to be displayed, but we are tearing. Why render? diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index bee1605d..a685f735 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -846,7 +846,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) { // tearing and DS first bool shouldTear = false; - recheckSolitaryForMonitor(pMonitor); if (pMonitor->tearingState.nextRenderTorn) { pMonitor->tearingState.nextRenderTorn = false;