summaryrefslogtreecommitdiff
path: root/src/desktop/view/Window.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2026-04-07 14:09:06 +0100
committerVaxry <43317083+vaxerski@users.noreply.github.com>2026-04-07 12:07:36 -0400
commit0448e707fce798d6864320ef629ae681845bde26 (patch)
treebea6ed92bcb2abef80bef756c60ca167598104ea /src/desktop/view/Window.cpp
parent8a97b11b22422bcb6907a66010388856317c7ff5 (diff)
desktop/popup: cache tree count
Diffstat (limited to 'src/desktop/view/Window.cpp')
-rw-r--r--src/desktop/view/Window.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp
index b9c90ac9..35a706a1 100644
--- a/src/desktop/view/Window.cpp
+++ b/src/desktop/view/Window.cpp
@@ -742,7 +742,10 @@ bool CWindow::isInCurvedCorner(double x, double y) {
// checks if the wayland window has a popup at pos
bool CWindow::hasPopupAt(const Vector2D& pos) {
- if (m_isX11)
+ if (m_isX11 || !m_popupHead)
+ return false;
+
+ if (m_popupHead->popupTreeCount() == 0)
return false;
auto popup = m_popupHead->at(pos);
@@ -933,9 +936,7 @@ int CWindow::popupsCount() {
if (m_isX11 || !m_popupHead)
return 0;
- int no = -1;
- m_popupHead->breadthfirst([](WP<Desktop::View::CPopup> p, void* d) { *sc<int*>(d) += 1; }, &no);
- return no;
+ return m_popupHead->popupTreeCount();
}
int CWindow::surfacesCount() {