Skip to content

Commit

Permalink
renderer: fix CRendererHintsPassElement reset duplication issue
Browse files Browse the repository at this point in the history
  • Loading branch information
raybbian committed Jan 1, 2025
1 parent dde3e08 commit 2678c7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/render/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>(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) {
// allow rendering without a workspace. In this case, just render layers.

Expand Down Expand Up @@ -1893,7 +1896,6 @@ void CHyprRenderer::ensureCursorRenderingMode() {
}

void CHyprRenderer::setCursorHidden(bool hide) {

if (hide == m_bCursorHidden)
return;

Expand Down Expand Up @@ -1935,7 +1937,6 @@ std::tuple<float, float, float> CHyprRenderer::getRenderTimes(PHLMONITOR pMonito
}

static int handleCrashLoop(void* data) {

g_pHyprNotificationOverlay->addNotification("Hyprland will crash in " + std::to_string(10 - (int)(g_pHyprRenderer->m_fCrashingDistort * 2.f)) + "s.", CHyprColor(0), 5000,
ICON_INFO);

Expand Down Expand Up @@ -2053,7 +2054,6 @@ void CHyprRenderer::unsetEGL() {
}

bool CHyprRenderer::beginRender(PHLMONITOR pMonitor, CRegion& damage, eRenderMode mode, SP<IHLBuffer> buffer, CFramebuffer* fb, bool simple) {

makeEGLCurrent();

m_sRenderPass.clear();
Expand Down
2 changes: 1 addition & 1 deletion subprojects/hyprland-protocols

0 comments on commit 2678c7f

Please sign in to comment.