Commit 4abdc5b1 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Wayland: don't share the same Config between backend and clients

Sharing a single config leads to undesired side-effects. The GetConfigOperation
is assumed to always return a new copy of the current config that is not changed
unless registered to ConfigMonitor. When sharing a single copy this assumption is
broken which leads to misbehaviour in KDED.

This change makes GetConfigOperation always return a new copy of the config that
caller can register to ConfigMonitor if they want to, otherwise it remains
unchanged until released.

Reviewers: sebas, davidedmundson

Reviewed By: sebas

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 0dc788c2
......@@ -244,6 +244,7 @@ KScreen::AbstractBackend *BackendManager::loadBackendInProcess(const QString &na
//qCDebug(KSCREEN) << "Connecting ConfigMonitor to backend.";
m_inProcessBackend = qMakePair<KScreen::AbstractBackend*, QVariantMap>(backend, arguments);
return backend;
......@@ -167,7 +167,6 @@ void ConfigMonitor::Private::edidReady(QDBusPendingCallWatcher* watcher)
void ConfigMonitor::Private::updateConfigs(const KScreen::ConfigPtr &newConfig)
Q_ASSERT(BackendManager::instance()->method() == BackendManager::OutOfProcess);
QMutableListIterator<QWeakPointer<Config>> iter(watchedConfigs);
while (iter.hasNext()) {
KScreen::ConfigPtr config =;
......@@ -247,10 +246,8 @@ void ConfigMonitor::connectInProcessBackend(KScreen::AbstractBackend* backend)
if (config.isNull()) {
const QWeakPointer<Config> weakConfig = config.toWeakRef();
if (d->watchedConfigs.contains(weakConfig)) {
emit configurationChanged();
qCDebug(KSCREEN) << "Backend change!" << config;
......@@ -171,8 +171,7 @@ void GetConfigOperation::start()
if (BackendManager::instance()->method() == BackendManager::InProcess) {
auto backend = d->loadBackend();
d->config = backend->config();
d->config = backend->config()->clone();
} else {
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