Bug 456189 - Slideshows always begin with default wallpaper
Summary: Slideshows always begin with default wallpaper
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Image & Slideshow wallpaper plugins (show other bugs)
Version: master
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-06-30 23:37 UTC by Nate Graham
Modified: 2022-07-02 00:31 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2022-06-30 23:37:23 UTC
Everything KDE from git master. This started happening 4 or 5 days ago (only getting around to reporting it now, sorry).

STEPS TO REPRODUCE
1. Set the desktop or lock screen to be a slideshow, and add some more images to it
2. restart the computer or plasmashell, or lock the screen

OBSERVED RESULT
The first image shown in the slideshow is always the default wallpaper. The next one is always random as expected though.

EXPECTED RESULT
The first image shown in the slideshow is random.
Comment 1 Fushan Wen 2022-07-01 00:45:33 UTC
Can reproduce when there are not many images in the list. The default 
wallpaper is set by `useSingleImageDefaults()` in MediaProxy ctor but in 
slideshow mode the slideshow backend should replace it with a random image.

I can test it by inserting console.log to onModelImageChanged


>  /usr/libexec/kscreenlocker_greet 2>&1|grep wp
qml: wpmodel 
image://package/get?dir=/usr/share/wallpapers/Next/&targetWidth=1920&targetHeight=1080
qml: wpmodel 
image://package/get?dir=/usr/share/wallpapers/Next/&targetWidth=1920&targetHeight=1080
qml: wpmodel 
image://package/get?dir=/usr/share/wallpapers/Next/&targetWidth=1920&targetHeight=1080
qml: wpmodel 
image://package/get?dir=/usr/share/wallpapers/Next/&targetWidth=1920&targetHeight=1080
qml: wpmodel 
image://package/get?dir=/usr/share/wallpapers/Next/&targetWidth=1920&targetHeight=1080
qml: wpmodel file:///home/qydw/.local/share/wallpapers/Cat.webp
qml: wpmodel file:///home/qydw/.local/share/wallpapers/Cat.webp
qml: wpmodel file:///home/qydw/.local/share/wallpapers/Cat.webp
qml: wpmodel file:///home/qydw/.local/share/wallpapers/Cat.webp
qml: wpmodel file:///home/qydw/.local/share/wallpapers/Cat.webp


But it didn't, which can be caused by Qt.callLater doesn't load the 
second image.
Comment 2 Bug Janitor Service 2022-07-01 02:22:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1883
Comment 3 Fushan Wen 2022-07-02 00:31:49 UTC
Git commit 02d56ca8b12cd224e1b791aa5d1f3ffacde3b86c by Fushan Wen.
Committed on 02/07/2022 at 00:23.
Pushed by fusionfuture into branch 'master'.

wallpapers/image: fix default image overriding the true image

The default image is set in MediaProxy ctor. When the default image is
still in loading status, the model image can change and be already
loaded before the default image is loaded, therefore there could be a
race condition that the default image is loaded later and overrides the
true image.

This stores the pending image and destroys the previous pending image
to fix the race condition.
FIXED-IN: 5.26

M  +35   -17   wallpapers/image/imagepackage/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/commit/02d56ca8b12cd224e1b791aa5d1f3ffacde3b86c