diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -54,10 +54,12 @@ #include #include #include +#include #include #include #include #include +#include #include "dolphinnewfilemenuobserver.h" #include "dolphin_detailsmodesettings.h" @@ -1058,7 +1060,14 @@ void DolphinView::dropUrls(const QUrl &destUrl, QDropEvent *dropEvent) { - KIO::DropJob* job = DragAndDropHelper::dropUrls(destUrl, dropEvent, this); + QWidget *dropWidget = this; +#if KIO_VERSION >= QT_VERSION_CHECK(5, 37, 0) + if (auto urlNavigator = qobject_cast(sender())) { + dropWidget = urlNavigator->dropWidget(); + } +#endif + + KIO::DropJob* job = DragAndDropHelper::dropUrls(destUrl, dropEvent, dropWidget); if (job) { connect(job, &KIO::DropJob::result, this, &DolphinView::slotPasteJobResult); diff --git a/src/views/draganddrophelper.h b/src/views/draganddrophelper.h --- a/src/views/draganddrophelper.h +++ b/src/views/draganddrophelper.h @@ -41,7 +41,7 @@ * @param destUrl URL of the item destination. Is used only if destItem::isNull() * is true. * @param event Drop event. - * @param window Associated widget. + * @param window Widget where the drop happened, will be used as parent of the drop menu. * @return KIO::DropJob pointer */ static KIO::DropJob* dropUrls(const QUrl& destUrl,