From b9e7d097a2cf7eb128cce01c920367aaa78320ff Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Fri, 29 May 2026 14:14:24 +0200 Subject: [PATCH] desktop/popup: fix reposition artifacts (#14820) visible() m_alpha check was reversed, m_lastPos cant be set in onReposition() and then later used in onCommit() it means its can be ahead of time and use wrong cords. also expand the damage box by 4 like done elsewhere. --- src/desktop/view/Popup.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/desktop/view/Popup.cpp b/src/desktop/view/Popup.cpp index 55af4d417..fbbe4d22e 100644 --- a/src/desktop/view/Popup.cpp +++ b/src/desktop/view/Popup.cpp @@ -69,7 +69,10 @@ eViewType CPopup::type() const { } bool CPopup::visible() const { - if ((!m_mapped || !m_wlSurface->resource()) && (!m_fadingOut || m_alpha->value() > 0.F)) + if (m_fadingOut && m_alpha->value() > 0.F) + return true; + + if (!m_mapped || !m_wlSurface->resource()) return false; if (!m_windowOwner.expired()) @@ -319,6 +322,7 @@ void CPopup::onCommit(bool ignoreSiblings) { if (m_lastSize != m_resource->m_surface->m_surface->m_current.size || m_requestedReposition || m_lastPos != COORDSLOCAL) { CBox box = {localToGlobal(m_lastPos), m_lastSize}; + box.expand(4); g_pHyprRenderer->damageBox(box); m_lastSize = m_resource->m_surface->m_surface->m_current.size; box = {COORDS, m_lastSize}; @@ -347,8 +351,6 @@ void CPopup::onReposition() { m_requestedReposition = true; - m_lastPos = coordsRelativeToParent(); - invalidateTreeExtentsCache(); reposition();