From d2a8b8c2de91b748f0c03ef36ecc3e2b7e4fceab Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 20 Jul 2023 18:27:14 +0200 Subject: [PATCH] renderer: cleanup back buffer skip checks --- src/render/Renderer.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 6613db2a..77b9fa84 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -2028,12 +2028,17 @@ bool CHyprRenderer::canSkipBackBufferClear(CMonitor* pMonitor) { if (!ls->layerSurface) continue; - if (!ls->layerSurface->surface->opaque || !(ls->alpha.fl() >= 1.f)) + if (ls->alpha.fl() < 1.f) continue; - if (ls->geometry.x == pMonitor->vecPosition.x && ls->geometry.y == pMonitor->vecPosition.y && ls->geometry.width == pMonitor->vecSize.x && - ls->geometry.height == pMonitor->vecSize.y) - return true; + if (ls->geometry.x != pMonitor->vecPosition.x || ls->geometry.y != pMonitor->vecPosition.y || ls->geometry.width != pMonitor->vecSize.x || + ls->geometry.height != pMonitor->vecSize.y) + continue; + + if (!ls->layerSurface->surface->opaque) + continue; + + return true; } return false;