summaryrefslogtreecommitdiff
path: root/src/desktop/view/Window.cpp
diff options
context:
space:
mode:
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() {