wayland: Reset dnd state when the target surface is about to be destroyed

Use the SurfaceInterface::aboutToBeDestroyed() for the consistency sake
with other code that performs cleanup when the wl_surface is destroyed.
This commit is contained in:
Vlad Zahorodnii 2024-06-12 16:36:01 +03:00
parent e1192a6934
commit 29a5541ccf

View file

@ -301,7 +301,7 @@ void DataDeviceInterface::updateDragTarget(SurfaceInterface *surface, quint32 se
d->send_motion(d->seat->timestamp().count(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y()));
});
}
d->drag.destroyConnection = connect(d->drag.surface, &QObject::destroyed, this, [this] {
d->drag.destroyConnection = connect(d->drag.surface, &SurfaceInterface::aboutToBeDestroyed, this, [this] {
d->send_leave();
if (d->drag.posConnection) {
disconnect(d->drag.posConnection);