From 3f62a386bf421d2199a6239928afc4f8d3f3e708 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 28 Jul 2022 22:15:56 +0200 Subject: [PATCH] surface damage fixes --- src/render/Renderer.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 6a42c29c..cb850f59 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -666,15 +666,21 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y) { pixman_region32_translate(&damageBox, x, y); + pixman_region32_t damageBoxForEach; + pixman_region32_init(&damageBoxForEach); + for (auto& m : g_pCompositor->m_vMonitors) { double lx = 0, ly = 0; wlr_output_layout_output_coords(g_pCompositor->m_sWLROutputLayout, m->output, &lx, &ly); - pixman_region32_translate(&damageBox, lx, ly); - wlr_region_scale(&damageBox, &damageBox, m->scale); + + wlr_region_scale(&damageBox, &damageBoxForEach, m->scale); + pixman_region32_translate(&damageBoxForEach, lx, ly); + wlr_output_damage_add(m->damage, &damageBox); - pixman_region32_translate(&damageBox, -lx, -ly); } + pixman_region32_fini(&damageBoxForEach); + static auto *const PLOGDAMAGE = &g_pConfigManager->getConfigValuePtr("debug:log_damage")->intValue; if (*PLOGDAMAGE)