Bug 413463 - Wallpaper slideshow set to "random" is not random at all
Summary: Wallpaper slideshow set to "random" is not random at all
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Image Wallpaper (show other bugs)
Version: 5.17.1
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-26 06:53 UTC by Mathias Homann
Modified: 2020-03-28 16:40 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.18.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias Homann 2019-10-26 06:53:22 UTC
SUMMARY
"random" wallpaper slideshow is not random anymore


STEPS TO REPRODUCE
1. Set up a random wallpaper slideshow
2. Observe, especially after logging in, that the wallpapers always show up in the same order
3. 

OBSERVED RESULT
Wallpapers seem to show alsways in the same order, also it's always the same wallpaper when I login

EXPECTED RESULT
I expect to see a different wallpaper every time I login, and I expect the following ones to be random.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.1
KDE Plasma Version: 5.17.1
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
Kernel Version: 4.12.14-lp151.28.20-default
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-4771 CPU @ 3.50GHz
Memory: 31,4 GiB
Comment 1 Mathias Homann 2019-10-26 19:49:21 UTC
i can actually choose "next wallpaper" from the desktop context menu, and I'll always get the same sequence of wallpapers....

so ... NOT random.
Comment 2 David Edmundson 2019-10-27 16:12:15 UTC
You're right, fix(es) on review.
Comment 3 Mathias Homann 2019-10-28 07:51:30 UTC
is this by any chance related to the "plasma crashes during wallpaper change" fixes?
Comment 4 Nate Graham 2019-10-29 17:59:12 UTC
Patches are https://phabricator.kde.org/D24985 and https://phabricator.kde.org/D24986.
Comment 5 Nate Graham 2019-10-29 19:38:57 UTC
Git commit 868a6a9f62546be0c409615501bf54fb6fa8c910 by Nate Graham, on behalf of David Edmundson.
Committed on 29/10/2019 at 19:38.
Pushed by ngraham into branch 'Plasma/5.17'.

[wallpapers/image] Seed random number generator

Summary:
Otherwise when we randomise the wallpaper order we will always get the
same results.

Test Plan: qDebug + ran twice

Reviewers: #plasma, ngraham, davidre

Reviewed By: ngraham, davidre

Subscribers: davidre, apol, anthonyfieroni, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24985

M  +1    -0    wallpapers/image/slidefiltermodel.cpp

https://commits.kde.org/plasma-workspace/868a6a9f62546be0c409615501bf54fb6fa8c910
Comment 6 Nate Graham 2019-10-29 19:39:31 UTC
Git commit 9dca7d6cd44cbb16c6d7fb1aca5588760544b1d6 by Nate Graham, on behalf of David Edmundson.
Committed on 29/10/2019 at 19:39.
Pushed by ngraham into branch 'Plasma/5.17'.

[wallpapers/image] Randomise new batches of images in the slideshow

Summary:
There was a concious decision that when we add a new wallpaper we should
append to the existing random order collection, rather than shuffle
existing ones.

The logic is fine but if we start with 0 wallpapers and then add 20 new
ones we don't shuffle anything.

This patch changes it so when a new batch of N wallpapers is added,
those N are shuffled when appending to the existing sort order.
FIXED-IN: 5.17.2

Test Plan: qDebug + ran a few times

Reviewers: #plasma, ngraham, davidre

Reviewed By: ngraham, davidre

Subscribers: davidre, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24986

M  +1    -0    wallpapers/image/slidefiltermodel.cpp

https://commits.kde.org/plasma-workspace/9dca7d6cd44cbb16c6d7fb1aca5588760544b1d6
Comment 7 Marcin Gurtowski 2019-12-08 11:12:29 UTC
(In reply to Nate Graham from comment #6)
> Git commit 9dca7d6cd44cbb16c6d7fb1aca5588760544b1d6 by Nate Graham, on
> behalf of David Edmundson.
> Committed on 29/10/2019 at 19:39.
> Pushed by ngraham into branch 'Plasma/5.17'.
> 
> [wallpapers/image] Randomise new batches of images in the slideshow
> 
> Summary:
> There was a concious decision that when we add a new wallpaper we should
> append to the existing random order collection, rather than shuffle
> existing ones.
> 
> The logic is fine but if we start with 0 wallpapers and then add 20 new
> ones we don't shuffle anything.
> 
> This patch changes it so when a new batch of N wallpapers is added,
> those N are shuffled when appending to the existing sort order.
> FIXED-IN: 5.17.2
> 
> Test Plan: qDebug + ran a few times
> 
> Reviewers: #plasma, ngraham, davidre
> 
> Reviewed By: ngraham, davidre
> 
> Subscribers: davidre, plasma-devel
> 
> Tags: #plasma
> 
> Differential Revision: https://phabricator.kde.org/D24986
> 
> M  +1    -0    wallpapers/image/slidefiltermodel.cpp
> 
> https://commits.kde.org/plasma-workspace/
> 9dca7d6cd44cbb16c6d7fb1aca5588760544b1d6

Has this been released yet? Because now on 5.17.4 after changing my wallpaper directories I can definitively see patterns. Namely wallpapers from new directory I added are all showed one after another, but old ones also continue to appear in same order as they are structured in a directory.

What's more after booting up the first wallpaper is actually random, but after that the next one will be second from the list, third one and so on.
Comment 8 Makhsim 2020-03-27 21:25:56 UTC
Version 5.17.5
string srand(time(nullptr)); exists
same problem: same order of pictures after login as after logins before
Comment 9 Nate Graham 2020-03-28 03:38:46 UTC
Can you check with Plasma 5.18? 5.17 is no longer supported, while 5.18 is an LTS release.
Comment 10 Makhsim 2020-03-28 14:16:08 UTC
On 5.18.3 works fine
Comment 11 Nate Graham 2020-03-28 16:40:33 UTC
Great, thanks.