diff --git a/shell/currentcontainmentactionsmodel.h b/shell/currentcontainmentactionsmodel.h --- a/shell/currentcontainmentactionsmodel.h +++ b/shell/currentcontainmentactionsmodel.h @@ -56,7 +56,7 @@ Q_INVOKABLE bool append(const QString &action, const QString &plugin); Q_INVOKABLE void update(int row, const QString &action, const QString &plugin); Q_INVOKABLE void remove(int row); - Q_INVOKABLE void showConfiguration(int row); + Q_INVOKABLE void showConfiguration(int row, QQuickItem *ctx = nullptr); Q_INVOKABLE void showAbout(int row, QQuickItem *ctx = nullptr); Q_INVOKABLE void save(); diff --git a/shell/currentcontainmentactionsmodel.cpp b/shell/currentcontainmentactionsmodel.cpp --- a/shell/currentcontainmentactionsmodel.cpp +++ b/shell/currentcontainmentactionsmodel.cpp @@ -181,7 +181,7 @@ } } -void CurrentContainmentActionsModel::showConfiguration(int row) +void CurrentContainmentActionsModel::showConfiguration(int row, QQuickItem *ctx) { const QString action = itemData(index(row, 0)).value(ActionRole).toString(); @@ -193,7 +193,11 @@ configDlg->setAttribute(Qt::WA_DeleteOnClose); QLayout *lay = new QVBoxLayout(configDlg); configDlg->setLayout(lay); - configDlg->setWindowModality(Qt::WindowModal); + if (ctx && ctx->window()) { + configDlg->setWindowModality(Qt::WindowModal); + configDlg->winId(); // so it creates the windowHandle(); + configDlg->windowHandle()->setTransientParent(ctx->window()); + } Plasma::ContainmentActions *pluginInstance = m_plugins[action]; //put the config in the dialog