renderer: fix CRendererHintsPassElement reset duplication issue (#8928)

This commit is contained in:
Raymond Bian 2025-01-02 06:51:59 -05:00 committed by GitHub
parent dde3e082c9
commit cbd2451570
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -807,13 +807,16 @@ void CHyprRenderer::renderAllClientsForWorkspace(PHLMONITOR pMonitor, PHLWORKSPA
if (scale != 1.f) if (scale != 1.f)
RENDERMODIFDATA.modifs.emplace_back(std::make_pair<>(SRenderModifData::eRenderModifType::RMOD_TYPE_SCALE, scale)); RENDERMODIFDATA.modifs.emplace_back(std::make_pair<>(SRenderModifData::eRenderModifType::RMOD_TYPE_SCALE, scale));
CScopeGuard x([] {});
if (!RENDERMODIFDATA.modifs.empty()) { if (!RENDERMODIFDATA.modifs.empty()) {
g_pHyprRenderer->m_sRenderPass.add(makeShared<CRendererHintsPassElement>(CRendererHintsPassElement::SData{RENDERMODIFDATA})); g_pHyprRenderer->m_sRenderPass.add(makeShared<CRendererHintsPassElement>(CRendererHintsPassElement::SData{RENDERMODIFDATA}));
x = CScopeGuard([] { g_pHyprRenderer->m_sRenderPass.add(makeShared<CRendererHintsPassElement>(CRendererHintsPassElement::SData{SRenderModifData{}})); });
} }
CScopeGuard x([&RENDERMODIFDATA] {
if (!RENDERMODIFDATA.modifs.empty()) {
g_pHyprRenderer->m_sRenderPass.add(makeShared<CRendererHintsPassElement>(CRendererHintsPassElement::SData{SRenderModifData{}}));
}
});
if (!pWorkspace) { if (!pWorkspace) {
// allow rendering without a workspace. In this case, just render layers. // allow rendering without a workspace. In this case, just render layers.