Bug 423987 - Can't apply wallpaper downloaded from GHNS
Summary: Can't apply wallpaper downloaded from GHNS
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Image Wallpaper (show other bugs)
Version: 5.19.3
Platform: Arch Linux Linux
: VHI normal
Target Milestone: 1.0
Assignee: Marco Martin
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-07-08 09:10 UTC by Piotr Mierzwinski
Modified: 2020-12-11 15:59 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: Plasma 5.21 or Frameworks 5.77
Sentry Crash Report:


Attachments
wallpaper before selection new (389.30 KB, image/png)
2020-07-08 12:54 UTC, Piotr Mierzwinski
Details
wallpaper after selection new (392.12 KB, image/png)
2020-07-08 12:54 UTC, Piotr Mierzwinski
Details
wallpaper for layout changed and restored (change in ComboBox) (392.04 KB, image/png)
2020-07-08 12:55 UTC, Piotr Mierzwinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2020-07-08 09:10:30 UTC
SUMMARY
I cannot change wallpaper. I tested this just before update Plasma to 5.19.3 (working on 5.19.2). I selected new wallpaper and clicked 'Apply'. In result happened nothing. After update to 5.19.3, I restarted PC and after that I got default wallpaper. Starting this moment I cannot change wallpaper to any different, just because after changing selection in 'Wallpaper,  button 'Apply' is always disabled.

Button 'Apply' can be enabled after changing Layout to 'Desktop' and back to 'Folder view' or any other setting like 'Positioning' and back to previous. Unfortunately pressing it (Apply button) doesn't bring any effect.

My 'Wallpaper' presets are as following: 
- Layout: Folder View
- Wallpaper type: Image
- Positioning: Scaled and Cropped


STEPS TO REPRODUCE
1. RMB on desktop and select 'Configure Desktop'
2. Having presets as described above select any wallpaper
3. if 'Apply' button is enabled then press it

OBSERVED RESULT
No change. And in case of next try button 'Apply' is disabled

EXPECTED RESULT
Change of wallpaper

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: YES
(available in About System)
KDE Plasma Version: 5.19.3
KDE Frameworks Version: 5.71
Qt Version: 5.15.0

ADDITIONAL INFORMATION
Comment 1 David Edmundson 2020-07-08 10:32:44 UTC
Can you include some screenshots please.
Comment 2 Piotr Mierzwinski 2020-07-08 12:54:32 UTC
Created attachment 129972 [details]
wallpaper before selection new
Comment 3 Piotr Mierzwinski 2020-07-08 12:54:55 UTC
Created attachment 129973 [details]
wallpaper after selection new
Comment 4 Piotr Mierzwinski 2020-07-08 12:55:56 UTC
Created attachment 129974 [details]
wallpaper for layout changed and restored (change in ComboBox)
Comment 5 Piotr Mierzwinski 2020-07-08 13:03:27 UTC
To be more detailed.
After yesterday update of Plasma and try of change a wallpaper I turned off my PC. Today after I turned on my PC I found default wallpaper (for Plasma 5.19).

I'm not sure if this affects but:
- Application Style I use is: kvantum
- Window decoration: Material (originating from git repo.)
- Colors: ROUNDED-DARK
- Plasma Style: ROUNDED-COLOR

Session is X11 (The xcb windowing system). I didn't check it in Wayland.
Comment 6 Nate Graham 2020-07-10 21:05:06 UTC
Crap, I can reproduce. This affects wallpapers shipped in a package that do *not* come from kdeplasma-addons (for some reason). I can reliably hit it trying to switch to a wallpaper downloaded from GHNS or the package wallpaper shipped with my distro (openSUSE TW).

Reverting https://invent.kde.org/plasma/plasma-workspace/-/commit/530b36abb0a0a04958417cf914906fb64ab64062 fixes it for me.. I didn't see this issue in testing because I tested with local wallpapers from files, and package wallpapers from among the ones shipped in kdeplasma-addons, but I did not test with any wallpapers from GHNS.
Comment 7 David Edmundson 2020-07-13 14:28:31 UTC
filepath != X-KDE-PluginInfo-Name for some packages apparently


Distinction on whether it works correctly is whether the metadata is broken or not.
Comment 8 Bug Janitor Service 2020-07-13 14:57:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/152
Comment 9 Piotr Mierzwinski 2020-07-13 20:11:44 UTC
(In reply to Nate Graham from comment #6)

> Reverting
> https://invent.kde.org/plasma/plasma-workspace/-/commit/
> 530b36abb0a0a04958417cf914906fb64ab64062 fixes it for me.. I didn't see this
> issue in testing because I tested with local wallpapers from files, and
> package wallpapers from among the ones shipped in kdeplasma-addons, but I
> did not test with any wallpapers from GHNS.

I confirm. I applied amendment you suggested and changing wallpaper started work for me. I modified manually qml file (WallpaperDelegate.qml) placed in:
/usr/share/plasma/wallpapers/org.kde.image/contents/ui
Like this:
onClicked: {
if (configDialog.currentWallpaper == "org.kde.image") {
cfg_Image = model.path;
}
Thanks for help.
Comment 10 Nate Graham 2020-07-16 14:56:16 UTC
Git commit cbeae8e16eee3ba6fd66246805fa362292cc6e48 by Nate Graham, on behalf of David Edmundson.
Committed on 16/07/2020 at 14:56.
Pushed by ngraham into branch 'Plasma/5.19'.

[wallpaper] Avoid using pluginId for indexing package indexes

Image takes a string and loads the relevant package at a given path
wallpapers+packageName

pluginId typically is the same as the package name on disk, but not
always, either due to bad metadata or it being deliberately mangled
during install to avoid escaped characters.

Returning the package path has the same desired effect for saving
chosen images by package names, but avoids the complexity above.

metaData presence is still queried to separate real packages from the
fake packages generated internally which represent just one image.


(cherry picked from commit 74e9f990ae6c461ec9848b68e537732eeb458eca)

M  +1    -1    wallpapers/image/backgroundlistmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/cbeae8e16eee3ba6fd66246805fa362292cc6e48
Comment 11 Nate Graham 2020-07-16 14:56:38 UTC
Fixed by https://invent.kde.org/plasma/plasma-workspace/-/commit/74e9f990ae6c461ec9848b68e537732eeb458eca in Plasma 5.19.4

Sorry for the headache.
Comment 12 Piotr Mierzwinski 2020-11-04 13:14:01 UTC
This is again is broken. I noticed it when I wasn't able to change wallpaper to installed one (by ocs-url) from store.kde.org.

Checking qml code this looks like regression. Note that with ".new" extension is one which works. I applied such change in the past and mentioned at 2020-07-13 22:11:44.

$ diff WallpaperDelegate.qml WallpaperDelegate.qml.new
24a25
> import org.kde.plasma.components 2.0 as PlasmaComponents
127,128c128,129
<         if (configDialog.currentWallpaper == "org.kde.image") {
<             cfg_Image = model.packageName || model.path;
---
>       if (configDialog.currentWallpaper == "org.kde.image") {
>           cfg_Image = model.path;

File I found in package plasma-workspace 5.20.2-1

I tested this also in KDE Neon (unstable edition, so with Plasma 5.20.80) and seems works. I checked qml code and turned out that this logic has been rewritten in new way.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: YES
(available in About System)
KDE Plasma Version: 5.20.2
KDE Frameworks Version: 5.75
Qt Version: 5.15.1
Comment 13 Nate Graham 2020-11-04 17:57:11 UTC
Which wallpaper? Any of them or just some? Are you interested in submitting a merge request to fix it?
Comment 14 Piotr Mierzwinski 2020-11-04 20:44:48 UTC
(In reply to Nate Graham from comment #13)
> Which wallpaper? Any of them or just some? Are you interested in submitting
> a merge request to fix it?

Looking at code seems to the problem is the same like in the past.

Which wallpapaers? For example these:
https://store.kde.org/p/1441338/
https://store.kde.org/p/1441324/
and all other what in Desktop Settings call like: "Wine Leave".

I sent merge request:
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/420
Comment 15 Nate Graham 2020-12-10 15:05:47 UTC
Is this still happening for you? In git master with Frameworks 5.77, this is working for me with those wallpapers you mentioned, as well as any other one I try.
Comment 16 Piotr Mierzwinski 2020-12-10 16:02:48 UTC
(In reply to Nate Graham from comment #15)
> Is this still happening for you? In git master with Frameworks 5.77, this is
> working for me with those wallpapers you mentioned, as well as any other one
> I try.

Of course happens.
In file WallpaperDelegate.qml between Plasma version 5.20.2 and 5.20.4 (current stable) changed nothing.
Only worked when I modified this file manually, as described above.
Comment 17 Nate Graham 2020-12-10 16:51:11 UTC
Given that I could reproduce in the past, but I no longer can, it's safe to assume that something in the code changed between then and now. Unfortunately I don't know what it is, but happily this means that it should be fixed for you with either Plasma 5.21 or Frameworks 5.77!

Please re-open if it's still happening for you after upgrading to Plasma 5.21. Also feel free to mention if the Frameworks 5.77 upgrade fixed it for you, once that version is released in a few days.
Comment 18 Piotr Mierzwinski 2020-12-11 15:59:46 UTC
(In reply to Nate Graham from comment #17)
> Given that I could reproduce in the past, but I no longer can, it's safe to
> assume that something in the code changed between then and now.
> Unfortunately I don't know what it is, but happily this means that it should
> be fixed for you with either Plasma 5.21 or Frameworks 5.77!

If you have not (manually) changed WallpaperDelegate.qml file and you are able to change wallpaper such I mentioned then seems might be something different in code which causes that works for you.
Anyway. After yesterday test, when I restarted PC I got no wallpaper on my desktop.
I applied mentioned fix and all back to normal. I set wallpaper with success.

I tested this also in Neon distribution (unstable dev version) and change such wallpapers was working.