From 5636d2031e762e2c8a8427bf49c70180d3bde04b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 29 Jun 2022 11:21:42 +0200 Subject: [PATCH] simplify damageWindow --- src/render/Renderer.cpp | 44 +++++++++++------------------------------ 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 2f2a2975..67f43ff5 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -576,39 +576,19 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y) { } void CHyprRenderer::damageWindow(CWindow* pWindow) { - if (!pWindow->m_bIsFloating) { - // damage by size & pos - // TODO TEMP: revise when added shadows/etc - - wlr_box damageBox = pWindow->getFullWindowBoundingBox(); - for (auto& m : g_pCompositor->m_lMonitors) { - wlr_box fixedDamageBox = damageBox; - fixedDamageBox.x -= m.vecPosition.x; - fixedDamageBox.y -= m.vecPosition.y; - scaleBox(&fixedDamageBox, m.scale); - wlr_output_damage_add_box(m.damage, &fixedDamageBox); - } - - static auto *const PLOGDAMAGE = &g_pConfigManager->getConfigValuePtr("debug:log_damage")->intValue; - - if (*PLOGDAMAGE) - Debug::log(LOG, "Damage: Window floated (%s): xy: %d, %d wh: %d, %d", pWindow->m_szTitle.c_str(), damageBox.x, damageBox.y, damageBox.width, damageBox.height); - } else { - // damage by real size & pos + border size * 2 (JIC) - wlr_box damageBox = pWindow->getFullWindowBoundingBox(); - for (auto& m : g_pCompositor->m_lMonitors) { - wlr_box fixedDamageBox = damageBox; - fixedDamageBox.x -= m.vecPosition.x; - fixedDamageBox.y -= m.vecPosition.y; - scaleBox(&fixedDamageBox, m.scale); - wlr_output_damage_add_box(m.damage, &fixedDamageBox); - } - - static auto *const PLOGDAMAGE = &g_pConfigManager->getConfigValuePtr("debug:log_damage")->intValue; - - if (*PLOGDAMAGE) - Debug::log(LOG, "Damage: Window tiled (%s): xy: %d, %d wh: %d, %d", pWindow->m_szTitle.c_str(), damageBox.x, damageBox.y, damageBox.width, damageBox.height); + wlr_box damageBox = pWindow->getFullWindowBoundingBox(); + for (auto& m : g_pCompositor->m_lMonitors) { + wlr_box fixedDamageBox = damageBox; + fixedDamageBox.x -= m.vecPosition.x; + fixedDamageBox.y -= m.vecPosition.y; + scaleBox(&fixedDamageBox, m.scale); + wlr_output_damage_add_box(m.damage, &fixedDamageBox); } + + static auto* const PLOGDAMAGE = &g_pConfigManager->getConfigValuePtr("debug:log_damage")->intValue; + + if (*PLOGDAMAGE) + Debug::log(LOG, "Damage: Window (%s): xy: %d, %d wh: %d, %d", pWindow->m_szTitle.c_str(), damageBox.x, damageBox.y, damageBox.width, damageBox.height); } void CHyprRenderer::damageMonitor(SMonitor* pMonitor) {