wayland: Destroy xdg shell clients when corresponding roles are about to be destroyed

This ensures that surface role objects can be still accessed when either
XdgToplevelClient or XdgPopupClient is destroyed. As far as I know, it
doesn't cause any problems right now, but this makes resource destruction
handling consistent, we tend to perform cleanup in aboutToBeDestroyed
signal slots.
master
Vlad Zahorodnii 3 years ago
parent 51d82fc6e5
commit 4ca287641f

@ -54,6 +54,8 @@ XdgSurfaceClient::XdgSurfaceClient(XdgSurfaceInterface *shellSurface)
connect(shellSurface->surface(), &SurfaceInterface::mapped,
this, &XdgSurfaceClient::setReadyForPainting);
#endif
connect(shellSurface, &XdgSurfaceInterface::aboutToBeDestroyed,
this, &XdgSurfaceClient::destroyClient);
connect(shellSurface->surface(), &SurfaceInterface::aboutToBeDestroyed,
this, &XdgSurfaceClient::destroyClient);
@ -390,7 +392,7 @@ XdgToplevelClient::XdgToplevelClient(XdgToplevelInterface *shellSurface)
this, &XdgToplevelClient::handleTransientForChanged);
connect(shellSurface, &XdgToplevelInterface::initializeRequested,
this, &XdgToplevelClient::initialize);
connect(shellSurface, &XdgToplevelInterface::destroyed,
connect(shellSurface, &XdgToplevelInterface::aboutToBeDestroyed,
this, &XdgToplevelClient::destroyClient);
connect(shellSurface, &XdgToplevelInterface::maximumSizeChanged,
this, &XdgToplevelClient::handleMaximumSizeChanged);
@ -1749,7 +1751,7 @@ XdgPopupClient::XdgPopupClient(XdgPopupInterface *shellSurface)
this, &XdgPopupClient::initialize);
connect(shellSurface, &XdgPopupInterface::repositionRequested,
this, &XdgPopupClient::handleRepositionRequested);
connect(shellSurface, &XdgPopupInterface::destroyed,
connect(shellSurface, &XdgPopupInterface::aboutToBeDestroyed,
this, &XdgPopupClient::destroyClient);
}

Loading…
Cancel
Save