client: Fix crash on dnd updates after client facing drag ends
A platform drag and a application-facing drag have two different lifespans. The platform drag lasts until all mimedata is transferred and the client receiving the drops marks it as finished. The application facing QDrag lasts until the client deletes it. We can get a crash if we get updates during this time. The drop event is guarded, but not the action negotiation. Pick-to: 6.6 Change-Id: Ib9c047f04d65883105d4cd3f169637d0e038a63f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
ad0e538664
commit
9a8033ba5a
@ -101,6 +101,9 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supporte
|
||||
connect(m_dragSource.data(), &QWaylandDataSource::cancelled, this, &QWaylandDataDevice::dragSourceCancelled);
|
||||
connect(m_dragSource.data(), &QWaylandDataSource::dndResponseUpdated, this, [this](bool accepted, Qt::DropAction action) {
|
||||
auto drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag());
|
||||
if (!drag->currentDrag()) {
|
||||
return;
|
||||
}
|
||||
// in old versions drop action is not set, so we guess
|
||||
if (m_dragSource->version() < 3) {
|
||||
drag->setResponse(accepted);
|
||||
|
Loading…
x
Reference in New Issue
Block a user