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.
This commit is contained in:
Tom Englund
2026-06-07 12:26:02 +02:00
committed by Vaxry
parent d15b64e92a
commit b9e7d097a2
+5 -3
View File
@@ -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();