Fix creation of kdeglobals if /etc/xdg/kdeglobals present
ClosedPublic

Authored by fvogt on Jul 3 2019, 12:40 PM.

Details

Summary

If /etc/xdg/kdeglobals exists but ~/.config/kdeglobals
does not (like on the first start of kwin_wayland), it did not notice
changes to kdeglobals.
This lead to KWin using the wrong color scheme for the window decoration
on the first login, which also could not be changed without a session restart.

Test Plan

Cleared ~ and logged in again, title bar color is now correct.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
fvogt created this revision.Jul 3 2019, 12:40 PM
Restricted Application added a project: KWin. · View Herald TranscriptJul 3 2019, 12:40 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
fvogt requested review of this revision.Jul 3 2019, 12:40 PM

So if XDG_CONFIG_DIRS contains additional locations, this will not work?

e.g. in Kubuntu we set up: XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS:/usr/share/kubuntu-default-settings/kf5-settings"

broulik added a subscriber: broulik.Jul 3 2019, 1:07 PM

Yeah I would suggest taking into account QStandardPaths::writableLocation

fvogt added a comment.Jul 3 2019, 1:10 PM

Basically doing
!m_colorScheme.startsWith(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation))
instead might work, but maybe there are cases with more than once writable location?

The failure mode would be better though, writing to kdeglobals even if not necessary, compared to not creating kdeglobals at all.

sitter added a subscriber: sitter.Jul 3 2019, 1:30 PM

Not as far as QSP is concerned and that's all that matters here I think. QStandardPaths::locate can return any of XDG_CONFIG_{DIRS,HOME} QStandardPaths::writableLocation only returns _HOME. So as far as QSP and KConfig are concerned there is only one writable location.

fvogt updated this revision to Diff 61069.Jul 3 2019, 1:32 PM

Do it differently.

fvogt edited the summary of this revision. (Show Details)Jul 3 2019, 1:32 PM
romangg accepted this revision.Jul 10 2019, 8:59 AM
This revision is now accepted and ready to land.Jul 10 2019, 8:59 AM
This revision was automatically updated to reflect the committed changes.