popup: damage old size on unmap as well as new (#10306)

fixes #10305

chromium for some reason sets the popup size to like 8x8 at the same time as unmapping
This commit is contained in:
Vaxry 2025-05-06 21:49:20 +02:00 committed by GitHub
parent 708a7c24ef
commit 948277895e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -129,6 +129,10 @@ void CPopup::onUnmap() {
m_mapped = false; 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; m_lastSize = m_resource->m_surface->m_surface->m_current.size;
const auto COORDS = coordsGlobal(); const auto COORDS = coordsGlobal();
@ -137,6 +141,10 @@ void CPopup::onUnmap() {
box.translate(COORDS).expand(4); box.translate(COORDS).expand(4);
g_pHyprRenderer->damageBox(box); 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(); m_subsurfaceHead.reset();
if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP) if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)