Bug 65084

Summary: random wallpaper changing algorithm not random enough
Product: kdesktop Reporter: Timo Nentwig <kde>
Component: generalAssignee: David Faure <faure>
Status: CLOSED NOT A BUG    
Severity: normal CC: finex
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Timo Nentwig 2003-09-28 15:22:20 UTC
Version:           3.1.4 (using KDE 3.1.4)
Installed from:    SuSE
Compiler:          gcc version 3.3 20030226 (prerelease) (SuSE Linux)
OS:          Linux (i686) release 2.4.20-tcn

I setup the wallpaper changer with a directory holding about 1.500 images - which I quite a lot IMO.

However, often pictures are shown I already saw while I yet haven't seen the very most of the rest.
Comment 1 Stephan Kulow 2003-09-28 18:26:29 UTC
did you figure, it's against every logic that there are lotto wins? 
 
The code does rand() % count which is the standard way to get 
a random number in [0, count[ 
 
Comment 2 Timo Nentwig 2003-11-11 16:15:36 UTC
1) use multiple rand()s
2) use the pgp/gpg-like approach and generate random values by using mouse movement, keyboards input and the system time.
Comment 3 Stephan Kulow 2003-11-12 10:45:47 UTC
whatever random implementation you use, you can't exclude that you see the same picture after the second switch (it's random after all). The only way around this is creating a random list on startup and play that one by one.
Comment 4 Timo Nentwig 2003-11-12 10:59:41 UTC
For sure, but I can exclude that I do see the same pictures all the time and most of the pictures never or very seldomly. This bug report is about making it *more* random than it is right now.
Comment 5 David Faure 2003-11-12 11:06:35 UTC
Subject: Re:  random wallpaper changing algorithm not random enough

> For sure, but I can exclude that I do see the same pictures all the time and most of the pictures never or very seldomly.
Stephan is correct, the only way to do this is to randomize the list ONCE
and then go through it. 
This is the proper implementation of randomized wallpapers anyway, not
"using random to pick the next one each time".

Comment 6 FiNeX 2009-01-02 20:23:12 UTC
Bug closed. Kdesktop is no more mantained.