From edb3ee456633daf83407529d505836196f42441b Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 23 Nov 2023 22:30:52 +0000 Subject: [PATCH] fix blur --- src/render/OpenGL.cpp | 5 ++++- src/render/Renderer.cpp | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 326bf9dc..8bc0dcb3 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -118,6 +118,8 @@ GLuint CHyprOpenGLImpl::compileShader(const GLuint& type, std::string src, bool void CHyprOpenGLImpl::begin(CMonitor* pMonitor, CRegion* pDamage, bool fake) { m_RenderData.pMonitor = pMonitor; + static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue; + TRACY_GPU_ZONE("RenderBegin"); glViewport(0, 0, pMonitor->vecPixelSize.x, pMonitor->vecPixelSize.y); @@ -160,7 +162,8 @@ void CHyprOpenGLImpl::begin(CMonitor* pMonitor, CRegion* pDamage, bool fake) { const auto PRBO = g_pHyprRenderer->getCurrentRBO(); - if (m_sFinalScreenShader.program > 0 || m_bFakeFrame || m_RenderData.mouseZoomFactor != 1.0 || pMonitor->vecPixelSize != PRBO->getFB()->m_vSize) { + if (m_sFinalScreenShader.program > 0 || m_bFakeFrame || m_RenderData.mouseZoomFactor != 1.0 || pMonitor->vecPixelSize != PRBO->getFB()->m_vSize || + *PBLUR != 0 /* TODO: revisit when possible */) { // we have to offload // bind the primary Hypr Framebuffer m_RenderData.pCurrentMonData->offloadFB.bind(); diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index dbc0e160..88b6a696 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1063,7 +1063,14 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) { g_pHyprOpenGL->m_RenderData.useNearestNeighbor = false; } - beginRender(pMonitor, damage, RENDER_MODE_NORMAL); + if (!beginRender(pMonitor, damage, RENDER_MODE_NORMAL)) { + Debug::log(ERR, "renderer: couldn't beginRender()!"); + + if (UNLOCK_SC) + wlr_output_lock_software_cursors(pMonitor->output, false); + + return; + } EMIT_HOOK_EVENT("render", RENDER_BEGIN);