Bug 504934 - Entering the Wallpaper KCM immediately shows it as having unsaved changes
Summary: Entering the Wallpaper KCM immediately shows it as having unsaved changes
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_wallpaper (other bugs)
Version First Reported In: 6.3.90
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-05-28 19:27 UTC by John Veness
Modified: 2025-06-04 06:43 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.4.0
Sentry Crash Report:


Attachments
My ~/.config/plasma-org.kde.plasma.desktop-appletsrc (8.79 KB, text/plain)
2025-05-29 11:54 UTC, John Veness
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Veness 2025-05-28 19:27:36 UTC
SUMMARY
Since, I think, the new "Switch dynamic wallpapers" feature was merged, if I enter the Wallpaper KCM, it immediately shows it as having unsaved changes.

STEPS TO REPRODUCE
1. Open System Settings for first time since the "Switch dynamic wallpapers" feature was merged
2. Navigate to Wallpaper

OBSERVED RESULT
An asterisk is in the titlebar. The Apply button is not greyed-out. If you click on another KCM, you are asked if you want to Discard or Apply unsaved changes.

EXPECTED RESULT
None of the above to happen.

ADDITIONAL INFORMATION
Presumably this is because a new setting has been introduced. Maybe there's an elegant way to handle this? I don't remember this sort of thing (a KCM showing it has unsaved changes) with previous Plasma upgrades, even when new settings are introduced. Thanks!
Comment 1 Nate Graham 2025-05-28 20:22:26 UTC
Can reproduce.
Comment 2 Vlad Zahorodnii 2025-05-29 07:01:43 UTC
Doesn't happen on my machine.
Comment 3 Vlad Zahorodnii 2025-05-29 07:20:01 UTC
Can you share your ~/.config/plasma-org.kde.plasma.desktop-appletsrc?
Comment 4 John Veness 2025-05-29 11:54:32 UTC
Created attachment 181862 [details]
My ~/.config/plasma-org.kde.plasma.desktop-appletsrc

By the way, I assume that if I click Apply, that will fix this, but I deliberately haven't done that so I can replicate this issue. And anyway, it would still be a papercut.
Comment 5 Vlad Zahorodnii 2025-05-29 12:01:49 UTC
I applied your settings and I still can't reproduce the issue.
Comment 6 Nate Graham 2025-05-29 16:05:39 UTC
So this is weird, but with today's git master, I can't reproduce the issue anymore. I could yesterday with the same wallpaper settings (I haven't changed them), so either this is intermittent, or else it's fixed now. Let's call it fixed until it happens again, at which point we can investigate further.
Comment 7 John Veness 2025-05-29 22:01:44 UTC
I've just updated git master and it's still happening for me, consistently :(

If I rename ~/.config/plasma-org.kde.plasma.desktop-appletsrc it doesn't happen. If I rename it back, it happens again.

I notice that when I rename ~/.config/plasma-org.kde.plasma.desktop-appletsrc and logout/login again, that my wallpaper has changed. It was Nuvole and changes to Coast.
Comment 8 John Veness 2025-05-29 22:22:45 UTC
Narrowing it down, if I delete:

[Containments][26][Wallpaper][org.kde.image][General]
Image=/usr/share/wallpapers/Next/
PreviewImage=/usr/share/wallpapers/Next/
SlidePaths=/usr/share/wallpapers/

from my ~/.config/plasma-org.kde.plasma.desktop-appletsrc and logout/login, the issue doesn't occur. So, something to do with that?
Comment 9 John Veness 2025-05-29 22:49:40 UTC
Even more specifically, removing the line:

PreviewImage=/usr/share/wallpapers/Next/

fixes the issue. Putting that line back in, it re-occurs.
Comment 10 John Veness 2025-05-29 22:56:12 UTC
Something to do with https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5344 maybe? (Rather than the "Switch dynamic wallpapers" feature).
Comment 11 cwo 2025-05-30 06:56:22 UTC
Can reproduce with these steps.

I think it's two issues - PreviewImage should not be saved in the first place (it's a bit of internal trickery we use in the desktop dialog to immediately show the wallpaper you're highlighting in the dialog), but if it is, kcm_wallpaper should not consider it changed.

I'll work on a solution to both.
Comment 12 Bug Janitor Service 2025-05-30 07:10:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5539
Comment 13 Bug Janitor Service 2025-05-30 08:27:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5541
Comment 14 John Veness 2025-05-30 10:46:57 UTC
Thanks @cwo, your MRs fix the issue I was seeing :). Hopefully they can make their way into 6.4 before release as I notice the original issue is currently present in the beta and is worse than I thought: unlike what I thought in comment 4, pressing Apply in the KCM *didn't* fix the issue, so it wouldn't have been just been a one-off papercut for users.

Apologies to Vlad for incorrectly assuming this was related to the "Switch dynamic wallpapers" feature - it was the obvious visual change in the KCM when I originally saw the issue in master, but I shouldn't have made an assumption that it was to do with that.
Comment 15 cwo 2025-05-30 14:09:20 UTC
Git commit 55cd5f0adb2a2e6f257ec2f4820b75ca40c7c3d9 by Christoph Wolk.
Committed on 30/05/2025 at 13:18.
Pushed by cwo into branch 'master'.

kcms/wallpaper: don't load PreviewImage

PreviewImage is a temporary internal key that shouldn't be stored, but
was (and will still be present in existing configs, as the Containment
dialog wrote it to disk). kcm_wallpaper does not write it, but if it is
present in the file, it may mark the kcm as needing save to remove it.

Instead, don't consider the key at all.

M  +1    -0    kcms/wallpaper/wallpapermodule.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/55cd5f0adb2a2e6f257ec2f4820b75ca40c7c3d9
Comment 16 cwo 2025-05-30 16:02:34 UTC
Git commit d4ca36ad788e0ca43f8f9fce521f1e6d91fd531d by Christoph Wolk.
Committed on 30/05/2025 at 15:38.
Pushed by cwo into branch 'master'.

wallpapers/image: clear Preview key before saving

Image sets a preview key, which overrides the current main wallpaper,
intended for use in the Desktop containment config dialog to immediately
preview the currently selected wallpaper. This is written to the config
so in effect the preview is mostly used instead of the real image
setting, which is pointless.

Instead, we reset it to the default (string "null") right when saving;
this way the key does not end up in the file.

M  +1    -0    wallpapers/image/imagepackage/contents/ui/config.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/d4ca36ad788e0ca43f8f9fce521f1e6d91fd531d
Comment 17 Bug Janitor Service 2025-05-30 16:03:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5547
Comment 18 Bug Janitor Service 2025-05-30 20:42:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5549
Comment 19 cwo 2025-06-03 23:14:10 UTC
Git commit a2ac73f47c194293b9f9be033fce0a1e3ce72b02 by Christoph Wolk.
Committed on 03/06/2025 at 22:57.
Pushed by cwo into branch 'Plasma/6.4'.

kcms/wallpaper: don't load PreviewImage

PreviewImage is a temporary internal key that shouldn't be stored, but
was (and will still be present in existing configs, as the Containment
dialog wrote it to disk). kcm_wallpaper does not write it, but if it is
present in the file, it may mark the kcm as needing save to remove it.

Instead, don't consider the key at all.


(cherry picked from commit 55cd5f0adb2a2e6f257ec2f4820b75ca40c7c3d9)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +1    -0    kcms/wallpaper/wallpapermodule.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/a2ac73f47c194293b9f9be033fce0a1e3ce72b02
Comment 20 cwo 2025-06-04 06:43:01 UTC
Git commit 0630121d79b9c7871fa47282cf37d4822324a6a8 by Christoph Wolk.
Committed on 04/06/2025 at 06:14.
Pushed by davidedmundson into branch 'Plasma/6.4'.

wallpapers/image: clear Preview key before saving

Image sets a preview key, which overrides the current main wallpaper,
intended for use in the Desktop containment config dialog to immediately
preview the currently selected wallpaper. This is written to the config
so in effect the preview is mostly used instead of the real image
setting, which is pointless.

Instead, we reset it to the default (string "null") right when saving;
this way the key does not end up in the file.


(cherry picked from commit d4ca36ad788e0ca43f8f9fce521f1e6d91fd531d)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +1    -0    wallpapers/image/imagepackage/contents/ui/config.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/0630121d79b9c7871fa47282cf37d4822324a6a8