diff --git a/src/plugins/filemanager/core/dfmplugin-recent/utils/recentmanager.cpp b/src/plugins/filemanager/core/dfmplugin-recent/utils/recentmanager.cpp index faa23f8f8d..bc567168e5 100644 --- a/src/plugins/filemanager/core/dfmplugin-recent/utils/recentmanager.cpp +++ b/src/plugins/filemanager/core/dfmplugin-recent/utils/recentmanager.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -248,7 +249,10 @@ QUrl RecentHelper::rootUrl() void RecentHelper::removeRecent(const QList &urls) { - DDialog dlg; + //In wayland , dialog needs to set a parent , otherwise it will enter the window modal incorrectly + QWidget *parent = WindowUtils::isWayLand() ? qApp->activeWindow() : nullptr; + + DDialog dlg(parent); dlg.setIcon(QIcon::fromTheme("dialog-warning")); dlg.addButton(QObject::tr("Cancel", "button")); dlg.addButton(QObject::tr("Remove", "button"), true, DDialog::ButtonRecommend);