diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface_p.h b/src/plugins/platforms/wayland/qwaylandshellsurface_p.h index 51116c52a62..6499a2bb009 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface_p.h +++ b/src/plugins/platforms/wayland/qwaylandshellsurface_p.h @@ -84,6 +84,9 @@ public: virtual std::any surfaceRole() const { return std::any(); }; + virtual void attachPopup(QWaylandShellSurface *popup) { Q_UNUSED(popup); } + virtual void detachPopup(QWaylandShellSurface *popup) { Q_UNUSED(popup); } + protected: void resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset = {0, 0}); void repositionFromApplyConfigure(const QPoint &position); diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 74db519f804..c48c9ddd00c 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -1635,11 +1635,15 @@ void QWaylandWindow::setXdgActivationToken(const QString &token) void QWaylandWindow::addChildPopup(QWaylandWindow *child) { + if (mShellSurface) + mShellSurface->attachPopup(child->shellSurface()); mChildPopups.append(child); } void QWaylandWindow::removeChildPopup(QWaylandWindow *child) { + if (mShellSurface) + mShellSurface->detachPopup(child->shellSurface()); mChildPopups.removeAll(child); }