diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-08-03 16:42:54 +0200 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-08-03 16:42:54 +0200 |
| commit | 0f1484c2f46245c7f02efa9db704ff63b3051601 (patch) | |
| tree | e9281da678b053e60513fc25d00c6b068fa838de /src/desktop/Subsurface.cpp | |
| parent | f6d8e86439473a5df84cbf1106dafee517f535b0 (diff) | |
subsurface: check surface size in damageLastArea
akin to CPopup, which already does this
Diffstat (limited to 'src/desktop/Subsurface.cpp')
| -rw-r--r-- | src/desktop/Subsurface.cpp | 12 |
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); } |
