diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -825,6 +825,9 @@ } QMenu *desktopMenu = new QMenu; + if (desktopMenu->winId()) { + desktopMenu->windowHandle()->setTransientParent(window()); + } emit applet()->contextualActionsAboutToShow(); ci->addAppletActions(desktopMenu, applet(), event); diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -481,6 +481,9 @@ m_dropJobs[job] = dropJob; } else { QMenu *choices = new QMenu(i18n("Content dropped")); + if (choices->winId()) { + choices->windowHandle()->setTransientParent(window()); + } choices->addAction(QIcon::fromTheme(QStringLiteral("process-working")), i18n("Fetching file type...")); choices->popup(window() ? window()->mapToGlobal(QPoint(x, y)) : QPoint(x, y)); @@ -521,6 +524,9 @@ QMenu *choices = nullptr; if (!dropJob) { choices = new QMenu(); + if (choices->winId()) { + choices->windowHandle()->setTransientParent(window()); + } } QList extraActions; QHash actionsToPlugins; @@ -999,6 +1005,9 @@ //qDebug() << "Invoking menu for applet" << applet; QMenu *desktopMenu = new QMenu; + if (desktopMenu->winId()) { + desktopMenu->windowHandle()->setTransientParent(window()); + } desktopMenu->setAttribute(Qt::WA_DeleteOnClose); m_contextMenu = desktopMenu;