data-device: send dndFinished when dnd offer is destroyed while unfinished

fixes #7496

see 711c5bb43f

see https://bugs.kde.org/show_bug.cgi\?id\=482142
This commit is contained in:
Vaxry
2024-08-28 13:45:06 +02:00
parent 7dd0f76e5a
commit 00ee1cf98e
4 changed files with 16 additions and 1 deletions

View File

@@ -67,6 +67,13 @@ CWLDataOfferResource::CWLDataOfferResource(SP<CWlDataOffer> resource_, SP<IDataS
});
}
CWLDataOfferResource::~CWLDataOfferResource() {
if (!source || !source->hasDnd() || dead)
return;
source->sendDndFinished();
}
bool CWLDataOfferResource::good() {
return resource->resource();
}
@@ -173,6 +180,7 @@ void CWLDataSourceResource::sendDndDropPerformed() {
if (resource->version() < 3)
return;
resource->sendDndDropPerformed();
dropped = true;
}
void CWLDataSourceResource::sendDndFinished() {