Bug 411876 - Plasma themes require non-FDO-compliant .desktop files
Summary: Plasma themes require non-FDO-compliant .desktop files
Status: CONFIRMED
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: libplasma (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-12 23:50 UTC by Adam Williamson
Modified: 2021-03-10 22:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Williamson 2019-09-12 23:50:36 UTC
Sorry if this is the wrong component, it's very hard to figure out the right one.

To create a working Plasma 5 theme, you are required to include a metadata.desktop file which seems not to be compliant with the FDO spec:

https://techbase.kde.org/Development/Tutorials/Plasma5/ThemeDetails (Plasma theme instructions)
https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html (FDO spec)

The instructions for Plasma cover sections named 'Settings', 'Wallpaper', 'ContrastEffect', and 'BlurBehindEffect' (it seems a section named 'Branding' is also possible). However, none of these sections is defined in the FDO spec, and the spec says:

"Alternatively, fields can be placed in their own group, where they may then have arbitrary key names. If this is the case, the group should follow the scheme outlined above, i.e. [X-PRODUCT GROUPNAME] or something similar. These steps will avoid namespace clashes between different yet similar environments."

i.e. when inventing a new group that is not covered in the spec, it is supposed to have X- prepended to its name (and ideally X-PRODUCT, e.g. X-Plasma or X-KDE in this case). desktop-file-validate enforces the spec in this way: if a .desktop file contains a non-standard group that is not prefixed with X-, validation will fail, so these metadata.desktop files fail validation.
Comment 1 David Edmundson 2019-09-13 10:29:20 UTC
Yes and no. It's not a valid Desktop Entry, but equally it's not being parsed as one.

Desktop Entries are for use in applications directories, or links.

This isn't one, it just happens to share the file extension. There's no reason for something that isn't us to be using this file, so there's nothing to clash with.

Does this cause a real world problem?
Comment 2 Adam Williamson 2019-09-13 15:36:50 UTC
It seems rather misleading to use the same extension and the same general format as a very widely-recognized specification, but not actually meet that specification. At the very least it could be specifically noted in the docs.

It did cause a real-world problem, yes:

https://bugzilla.redhat.com/show_bug.cgi?id=1745846#c10

it sufficiently confused a reviewer on the Fedora 31 backgrounds package that they required desktop-file-validate be run on the file and it be modified to pass that check...which of course meant it didn't work any more. This contributed to Fedora 31 Beta shipping with KDE having the wrong desktop background.
Comment 3 Christoph Feck 2019-09-16 21:22:18 UTC
New information was added with comment #2; changing status for inspection.

Maybe for Plasma 6 these could be renamed to *.metadata or port to *.json format instead.
Comment 4 Christoph Feck 2019-09-16 21:22:33 UTC
Changing status.