summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2021-07-22 09:02:43 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-02 14:54:50 +0000
commit2dcd37cbb893aac874ee090e5f6e2c1d1f1e3039 (patch)
tree267b0583751dae75612a4d7bad9497e94acab553
parent8fe61d79d6d629958da7e590174a0e0600652bed (diff)
downloadqtwayland-2dcd37cbb893aac874ee090e5f6e2c1d1f1e3039.tar.gz
Cleanup up all subsurface QQuickItems correctly
When showing a surface with a subsurface in a QML based compositor, the subsurface QQuickitems are now destroyed when when main surface QQuickItem is destroyed and not just when the surface is destroyed. This prevents subsurface QQuickItems piling up when showing and hiding the client surfaces e.g. inside a StackView. Fixes: QTBUG-94602 Change-Id: I006a6a763d4daf560ba2a7b6f83e1de3e3c48906 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 5463a04097ee7824b2032fb058e289cf62bfd315) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index 16b628c5..865363ec 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -723,6 +723,7 @@ void QWaylandQuickItem::handleSubsurfaceAdded(QWaylandSurface *childSurface)
childItem->setSurface(childSurface);
childItem->setVisible(true);
childItem->setParentItem(this);
+ childItem->setParent(this);
connect(childSurface, &QWaylandSurface::subsurfacePositionChanged, childItem, &QWaylandQuickItem::handleSubsurfacePosition);
connect(childSurface, &QWaylandSurface::destroyed, childItem, &QObject::deleteLater);
} else {