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

Authored by dvratil on Jan 15 2018, 9:22 PM.

Details

Summary

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.

Diff Detail

Repository
R110 KScreen Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dvratil created this revision.Jan 15 2018, 9:22 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 15 2018, 9:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
dvratil requested review of this revision.Jan 15 2018, 9:22 PM

Looks sensible to me.

To make sure I'm on the same page, out of process configs implicitly are copies of the one in the backend. So for consistent behaviour, in-process ones need to be explicitly cloned.

Can you look if 03aba1abd6f369116d0ee7dbce34ba88708ff124 should be reverted. I didn't understand how that made sense when it was merged and I think it was working round the problem you're fixing here.

Indeed for out-of-process backends the config arrives serialized via DBus and a new copy which is then passed to a client is created during serialization.

The change you mention is likely unrelated - it only mentions X11 which is always out-of-process, so not affected by this change, and does not look very sensible to me (if just because ConfigMonitor only holds weak references to Configs so by changing m_currentConfig there's a high chance the original config will be destroyed anyway).

sebas accepted this revision.Jan 16 2018, 4:06 PM

LGTM as well.

This revision is now accepted and ready to land.Jan 16 2018, 4:06 PM
This revision was automatically updated to reflect the committed changes.