From 49fb4cd94d4e2e3528ba4d2a22bc5ae858989105 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 22 Apr 2023 12:54:57 +0100 Subject: [PATCH] renderer: improvements to layer render detection --- src/render/OpenGL.cpp | 7 +++++++ src/render/Renderer.cpp | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index c1cd0a7d..5eecdfdf 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -816,6 +816,13 @@ CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, wlr_box* p } void CHyprOpenGLImpl::markBlurDirtyForMonitor(CMonitor* pMonitor) { + const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pMonitor->activeWorkspace); + const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(pMonitor->activeWorkspace); + + if (PWORKSPACE->m_bHasFullscreenWindow && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL && PFULLWINDOW && !PFULLWINDOW->m_vRealSize.isBeingAnimated() && + PFULLWINDOW->opaque()) + return; + m_mMonitorRenderResources[pMonitor].blurFBDirty = true; } diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index c81690bc..0be12fa7 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -443,7 +443,8 @@ void CHyprRenderer::renderAllClientsForWorkspace(CMonitor* pMonitor, CWorkspace* // if we have a fullscreen, opaque window that convers the screen, we can skip this. // TODO: check better with solitary after MR for tearing. const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(pWorkspace->m_iID); - if (g_pHyprOpenGL->m_RenderData.pCurrentMonData->blurFBDirty || !pWorkspace->m_bHasFullscreenWindow || pWorkspace->m_efFullscreenMode != FULLSCREEN_FULL || !PFULLWINDOW || PFULLWINDOW->m_vRealSize.isBeingAnimated() || !PFULLWINDOW->opaque()) { + if (!pWorkspace->m_bHasFullscreenWindow || pWorkspace->m_efFullscreenMode != FULLSCREEN_FULL || !PFULLWINDOW || PFULLWINDOW->m_vRealSize.isBeingAnimated() || + !PFULLWINDOW->opaque()) { for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]) { renderLayer(ls.get(), pMonitor, time); }