wayland: Track already existing subsurfaces in SubSurfaceMonitor

When the monitor is created, the surface may already have child
sub-surfaces. The childSubSurfaceAdded signal won't be emitted for them,
we need to handle this case explicitly.

BUG: 433511
FIXED-IN: 5.21.2
This commit is contained in:
Vlad Zahorodnii 2021-02-24 10:21:44 +02:00
parent 73dd65f452
commit e1279e516c

View file

@ -66,6 +66,11 @@ void SubSurfaceMonitor::registerSurface(SurfaceInterface *surface)
this, &SubSurfaceMonitor::registerSubSurface); this, &SubSurfaceMonitor::registerSubSurface);
connect(surface, &SurfaceInterface::childSubSurfaceRemoved, connect(surface, &SurfaceInterface::childSubSurfaceRemoved,
this, &SubSurfaceMonitor::unregisterSubSurface); this, &SubSurfaceMonitor::unregisterSubSurface);
const QList<SubSurfaceInterface *> childSubSurfaces = surface->childSubSurfaces();
for (SubSurfaceInterface *childSubSurface : childSubSurfaces) {
registerSubSurface(childSubSurface);
}
} }
void SubSurfaceMonitor::unregisterSurface(SurfaceInterface *surface) void SubSurfaceMonitor::unregisterSurface(SurfaceInterface *surface)