summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-29 11:21:42 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-29 11:21:42 +0200
commit5636d2031e762e2c8a8427bf49c70180d3bde04b (patch)
treeebb66b24641e4f2d8df480e39183e737fe67d069 /src/render/Renderer.cpp
parent9388bb5d5551a2d8affa7e3adea305711029b5cd (diff)
simplify damageWindow
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp42
1 files changed, 11 insertions, 31 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);
- }
+ 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;
+ 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);
- }
+ 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) {