From 0448e707fce798d6864320ef629ae681845bde26 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 7 Apr 2026 14:09:06 +0100 Subject: desktop/popup: cache tree count --- src/desktop/view/LayerSurface.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/desktop/view/LayerSurface.cpp') diff --git a/src/desktop/view/LayerSurface.cpp b/src/desktop/view/LayerSurface.cpp index 90de4cdc..a69dd8e9 100644 --- a/src/desktop/view/LayerSurface.cpp +++ b/src/desktop/view/LayerSurface.cpp @@ -426,12 +426,10 @@ bool CLayerSurface::isFadedOut() { } int CLayerSurface::popupsCount() { - if (!m_layerSurface || !m_mapped || m_fadingOut) + if (!m_layerSurface || !m_mapped || m_fadingOut || !m_popupHead) return 0; - int no = -1; // we have one dummy - m_popupHead->breadthfirst([](WP p, void* data) { *sc(data) += 1; }, &no); - return no; + return m_popupHead->popupTreeCount(); } MONITORID CLayerSurface::monitorID() { -- cgit v1.2.3