From cbd2451570d5c4d8b40035c3fcbabfb298385458 Mon Sep 17 00:00:00 2001 From: Raymond Bian Date: Thu, 2 Jan 2025 06:51:59 -0500 Subject: [PATCH] renderer: fix CRendererHintsPassElement reset duplication issue (#8928) --- src/render/Renderer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 9aa794b4..35150ce2 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -807,13 +807,16 @@ void CHyprRenderer::renderAllClientsForWorkspace(PHLMONITOR pMonitor, PHLWORKSPA if (scale != 1.f) RENDERMODIFDATA.modifs.emplace_back(std::make_pair<>(SRenderModifData::eRenderModifType::RMOD_TYPE_SCALE, scale)); - CScopeGuard x([] {}); - if (!RENDERMODIFDATA.modifs.empty()) { g_pHyprRenderer->m_sRenderPass.add(makeShared(CRendererHintsPassElement::SData{RENDERMODIFDATA})); - x = CScopeGuard([] { g_pHyprRenderer->m_sRenderPass.add(makeShared(CRendererHintsPassElement::SData{SRenderModifData{}})); }); } + CScopeGuard x([&RENDERMODIFDATA] { + if (!RENDERMODIFDATA.modifs.empty()) { + g_pHyprRenderer->m_sRenderPass.add(makeShared(CRendererHintsPassElement::SData{SRenderModifData{}})); + } + }); + if (!pWorkspace) { // allow rendering without a workspace. In this case, just render layers.