Possible fix for KDecoration crash in systemsettings

Authored by davidedmundson on Dec 12 2019, 10:20 AM.



I could never reproduce the crash, but we know from gdb that it's from
the decorationSettings object

We are setting the same QObject instance as a context property in
multiple contexts at once. This is already slightly odd especially from the POV of
Qt's internal property cache.

Given we want one object to be exposed to all contexts, we can expose it
to the parent context only once and achieve the same result in a simpler

BUG: 411166

Test Plan

Verified opening and closing system settings still worked for me.
I could never reproduce the original crash.

Diff Detail

R108 KWin
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: KWin. · View Herald TranscriptDec 12 2019, 10:20 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Dec 12 2019, 10:20 AM
apol added a subscriber: apol.Dec 12 2019, 11:54 AM

How about making it a singleton as well? Not be backwards-compatible but forward-compatible.

ngraham accepted this revision.Dec 14 2019, 2:52 PM
ngraham added a subscriber: ngraham.

This fixes the crash for me, which I can reproduce by opening System Settings, navigating to Colors, and them immediately navigating to Application Style > Window Decorations.

This revision is now accepted and ready to land.Dec 14 2019, 2:52 PM
This revision was automatically updated to reflect the committed changes.