diff --git a/src/desktop/Popup.cpp b/src/desktop/Popup.cpp index f35cedcbf..ed882c3ad 100644 --- a/src/desktop/Popup.cpp +++ b/src/desktop/Popup.cpp @@ -129,6 +129,10 @@ void CPopup::onUnmap() { m_mapped = false; + // if the popup committed a different size right now, we also need to damage the old size. + const Vector2D MAX_DAMAGE_SIZE = {std::max(m_lastSize.x, m_resource->m_surface->m_surface->m_current.size.x), + std::max(m_lastSize.y, m_resource->m_surface->m_surface->m_current.size.y)}; + m_lastSize = m_resource->m_surface->m_surface->m_current.size; const auto COORDS = coordsGlobal(); @@ -137,6 +141,10 @@ void CPopup::onUnmap() { box.translate(COORDS).expand(4); g_pHyprRenderer->damageBox(box); + // damage the last popup's explicit max size as well + box = CBox{COORDS, MAX_DAMAGE_SIZE}.expand(4); + g_pHyprRenderer->damageBox(box); + m_subsurfaceHead.reset(); if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)