From c5beecb2c31eeee470027a45d4737b716841215d Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 16 Dec 2025 15:01:38 +0000 Subject: [PATCH] desktop/popup: minor improvements --- src/desktop/view/Popup.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/desktop/view/Popup.cpp b/src/desktop/view/Popup.cpp index 31ea125b2..96a73f45c 100644 --- a/src/desktop/view/Popup.cpp +++ b/src/desktop/view/Popup.cpp @@ -68,7 +68,7 @@ eViewType CPopup::type() const { } bool CPopup::visible() const { - if (!m_mapped || !m_wlSurface->resource()) + if ((!m_mapped || !m_wlSurface->resource()) && (!m_fadingOut || m_alpha->value() > 0.F)) return false; if (!m_windowOwner.expired()) @@ -129,7 +129,7 @@ void CPopup::initAllSignals() { m_listeners.map = m_resource->m_surface->m_events.map.listen([this] { this->onMap(); }); m_listeners.unmap = m_resource->m_surface->m_events.unmap.listen([this] { this->onUnmap(); }); m_listeners.dismissed = m_resource->m_events.dismissed.listen([this] { this->onUnmap(); }); - m_listeners.destroy = m_resource->m_surface->m_events.destroy.listen([this] { this->onDestroy(); }); + m_listeners.destroy = m_resource->m_events.destroy.listen([this] { this->onDestroy(); }); m_listeners.commit = m_resource->m_surface->m_events.commit.listen([this] { this->onCommit(); }); m_listeners.newPopup = m_resource->m_surface->m_events.newPopup.listen([this](const auto& resource) { this->onNewPopup(resource); }); } @@ -150,6 +150,11 @@ void CPopup::onDestroy() { m_children.clear(); m_wlSurface.reset(); + m_listeners.map.reset(); + m_listeners.unmap.reset(); + m_listeners.commit.reset(); + m_listeners.newPopup.reset(); + if (m_fadingOut && m_alpha->isBeingAnimated()) { Debug::log(LOG, "popup {:x}: skipping full destroy, animating", rc(this)); return; @@ -394,6 +399,8 @@ void CPopup::recheckChildrenRecursive() { std::vector> cpy; std::ranges::for_each(m_children, [&cpy](const auto& el) { cpy.emplace_back(el); }); for (auto const& c : cpy) { + if (!c->visible()) + continue; c->onCommit(true); c->recheckChildrenRecursive(); }