Commit 0a656815 authored by David Edmundson's avatar David Edmundson

[kcmkwin] Make dialog non blocking

Summary:
It's invoked from QML.

Nested event loops invoked directly from QML is asking for crashes.

BUG: 419118

Test Plan:
Opened KCM
Opened dialog for some settings
Window was still modal as before
Settings were saved
(though they didn't seem to be applied..maybe another bug?)

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28293
parent 9755ef20
......@@ -634,7 +634,7 @@ void EffectsModel::requestConfigure(const QModelIndex &index, QWindow *transient
return;
}
QPointer<QDialog> dialog = new QDialog();
auto dialog = new QDialog();
KCModule *module = index.data(ScriptedRole).toBool()
? findScriptedConfig(index.data(ServiceNameRole).toString(), dialog)
......@@ -666,11 +666,13 @@ void EffectsModel::requestConfigure(const QModelIndex &index, QWindow *transient
layout->addWidget(module);
layout->addWidget(buttons);
if (dialog->exec() == QDialog::Accepted) {
connect(dialog, &QDialog::accepted, module, [module]() {
module->save();
}
});
delete dialog;
dialog->setModal(true);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
bool EffectsModel::shouldStore(const EffectData &data) const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment