aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-06-21 19:25:34 +0200
committerVaxry <[email protected]>2024-06-21 19:25:34 +0200
commit4a8b13ea4f8e5111390471c9212d10d4d032e837 (patch)
treefb9f86f0c1db6a2458401b371a63524ba8425e74
parent8cf2ca196620bc4431cbab83bfa25314e1e80ad7 (diff)
downloadHyprland-4a8b13ea4f8e5111390471c9212d10d4d032e837.tar.gz
Hyprland-4a8b13ea4f8e5111390471c9212d10d4d032e837.zip
renderer: shrink occlusion rect if blur is used
if we are blurring, we cannot be sure whether the occluded region won't be included in the expanded damage. If it is, we'd get dark shimmers. fixes #6547
-rw-r--r--src/render/Renderer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index b783ab81..4fc751ff 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -2451,9 +2451,14 @@ void CHyprRenderer::setOccludedForMainWorkspace(CRegion& region, PHLWORKSPACE pW
}
void CHyprRenderer::setOccludedForBackLayers(CRegion& region, PHLWORKSPACE pWorkspace) {
- CRegion rg;
+ CRegion rg;
- const auto PMONITOR = g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID);
+ const auto PMONITOR = g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID);
+
+ static auto PBLUR = CConfigValue<Hyprlang::INT>("decoration:blur:enabled");
+ static auto PBLURSIZE = CConfigValue<Hyprlang::INT>("decoration:blur:size");
+ static auto PBLURPASSES = CConfigValue<Hyprlang::INT>("decoration:blur:passes");
+ const auto BLURRADIUS = *PBLUR ? (*PBLURPASSES > 10 ? pow(2, 15) : std::clamp(*PBLURSIZE, (int64_t)1, (int64_t)40) * pow(2, *PBLURPASSES)) : 0;
for (auto& w : g_pCompositor->m_vWindows) {
if (!w->m_bIsMapped || w->isHidden() || w->m_pWorkspace != pWorkspace)
@@ -2468,7 +2473,8 @@ void CHyprRenderer::setOccludedForBackLayers(CRegion& region, PHLWORKSPACE pWork
CBox box = {POS.x, POS.y, SIZE.x, SIZE.y};
- box.scale(PMONITOR->scale);
+ box.scale(PMONITOR->scale).expand(-BLURRADIUS);
+
g_pHyprOpenGL->m_RenderData.renderModif.applyToBox(box);
rg.add(box);