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.