summaryrefslogtreecommitdiff
path: root/src/desktop/view/Popup.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-12-16 15:01:38 +0000
committerVaxry <vaxry@vaxry.net>2025-12-16 15:18:53 +0000
commitc5beecb2c31eeee470027a45d4737b716841215d (patch)
treec6a34e157164db05fb1ff10027b6815e34dd2433 /src/desktop/view/Popup.cpp
parent6e09eb2e6cc1744687f158f2a576de844be59f4e (diff)
desktop/popup: minor improvements
Diffstat (limited to 'src/desktop/view/Popup.cpp')
-rw-r--r--src/desktop/view/Popup.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/desktop/view/Popup.cpp b/src/desktop/view/Popup.cpp
index 31ea125b..96a73f45 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<uintptr_t>(this));
return;
@@ -394,6 +399,8 @@ void CPopup::recheckChildrenRecursive() {
std::vector<WP<CPopup>> 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();
}