diff --git a/src/wayland/surface_interface.cpp b/src/wayland/surface_interface.cpp index 3b78664436..e61d5794ba 100644 --- a/src/wayland/surface_interface.cpp +++ b/src/wayland/surface_interface.cpp @@ -43,6 +43,7 @@ void SurfaceInterface::Private::addChild(QPointer< SubSurfaceInterface > child) subSurfacePending.children.append(child); current.children.append(child); Q_Q(SurfaceInterface); + emit q->childSubSurfaceAdded(child); emit q->subSurfaceTreeChanged(); QObject::connect(child.data(), &SubSurfaceInterface::positionChanged, q, &SurfaceInterface::subSurfaceTreeChanged); QObject::connect(child->surface().data(), &SurfaceInterface::damaged, q, &SurfaceInterface::subSurfaceTreeChanged); @@ -57,6 +58,7 @@ void SurfaceInterface::Private::removeChild(QPointer< SubSurfaceInterface > chil subSurfacePending.children.removeAll(child); current.children.removeAll(child); Q_Q(SurfaceInterface); + emit q->childSubSurfaceRemoved(child); emit q->subSurfaceTreeChanged(); QObject::disconnect(child.data(), &SubSurfaceInterface::positionChanged, q, &SurfaceInterface::subSurfaceTreeChanged); if (!child->surface().isNull()) { diff --git a/src/wayland/surface_interface.h b/src/wayland/surface_interface.h index fb61978fda..ad8f24e415 100644 --- a/src/wayland/surface_interface.h +++ b/src/wayland/surface_interface.h @@ -330,6 +330,16 @@ Q_SIGNALS: * @since 5.22 **/ void subSurfaceTreeChanged(); + /** + * Emitted whenever a new child sub-surface @p subSurface is added. + * @since 5.70 + */ + void childSubSurfaceAdded(SubSurfaceInterface *subSurface); + /** + * Emitted whenver the child sub-surface @p subSurface is removed. + * @since 5.70 + */ + void childSubSurfaceRemoved(SubSurfaceInterface *subSurface); /** * Emitted whenever a pointer constraint get (un)installed on this SurfaceInterface.