summaryrefslogtreecommitdiff
path: root/src/desktop/Subsurface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/desktop/Subsurface.cpp')
-rw-r--r--src/desktop/Subsurface.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/desktop/Subsurface.cpp b/src/desktop/Subsurface.cpp
index d13a1344..ba7340f1 100644
--- a/src/desktop/Subsurface.cpp
+++ b/src/desktop/Subsurface.cpp
@@ -172,8 +172,16 @@ void CSubsurface::onUnmap() {
}
void CSubsurface::damageLastArea() {
- const auto COORDS = coordsGlobal() + m_lastPosition - m_subsurface->m_position;
- CBox box{COORDS, m_lastSize};
+ const auto COORDS = coordsGlobal() + m_lastPosition - m_subsurface->m_position;
+
+ const Vector2D MAX_DAMAGE_SIZE = m_wlSurface && m_wlSurface->resource() ?
+ Vector2D{
+ std::max(m_lastSize.x, m_wlSurface->resource()->m_current.size.x),
+ std::max(m_lastSize.y, m_wlSurface->resource()->m_current.size.y),
+ } :
+ m_lastSize;
+
+ CBox box{COORDS, m_lastSize};
box.expand(4);
g_pHyprRenderer->damageBox(box);
}