diff options
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index eeba6c85f..6649493b6 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -341,9 +341,26 @@ void QWaylandWindow::sendExposeEvent(const QRect &rect) QWindowSystemInterface::handleExposeEvent(window(), rect); } + +static QVector<QPointer<QWaylandWindow>> activePopups; + +void QWaylandWindow::closePopups(QWaylandWindow *parent) +{ + while (!activePopups.isEmpty()) { + auto popup = activePopups.takeLast(); + if (popup.isNull()) + continue; + if (popup.data() == parent) + return; + popup->reset(); + } +} + void QWaylandWindow::setVisible(bool visible) { if (visible) { + if (window()->type() == Qt::Popup) + activePopups << this; initWindow(); mDisplay->flushRequests(); @@ -357,6 +374,8 @@ void QWaylandWindow::setVisible(bool visible) // case 'this' will be deleted. When that happens, we must abort right away. QPointer<QWaylandWindow> deleteGuard(this); QWindowSystemInterface::flushWindowSystemEvents(); + if (!deleteGuard.isNull() && window()->type() == Qt::Popup) + closePopups(this); if (!deleteGuard.isNull()) reset(); } |