https://bugs.kde.org/show_bug.cgi?id=509711

            Bug ID: 509711
           Summary: Random wallpaper order: Non-ideal solution for
                    avoiding a duplicate item when slideshow restarts
    Classification: Plasma
           Product: plasmashell
      Version First 6.4.90
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Image & Slideshow wallpaper plugins
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
  Target Milestone: 1.0

SUMMARY
In the image slideshow, when a random order is selected and all items of the
current list were consumed and the next set of items is queued, the solution
for avoiding a duplicate item selection in the transition is not ideal and
leads to skipping one of the items.

The `ImageBackend::nextSlide()` function currently does this:
https://invent.kde.org/plasma/plasma-workspace/-/blob/v6.4.90/wallpapers/image/plugin/imagebackend.cpp#L411-420
- When the end of the slideshow has been reached (index is 0 again), reshuffle
it (`invalidate()`)
- Set the next item to the item with index 0
- If the previous item is the same as the next item, increase the index by 1
and set next that instead

This means that the item with index 0 will not be shown in this case, as it's
simply skipped due to it being the same as the previous one, as a valid
wallpaper transition needs to be ensured.

A more sensible idea would be swapping the first item with item [2...n] of the
reshuffled list, so that no item is skipped and every item will be shown.

>From looking at the code (I'm neither familiar with C++/Qt nor with the
plugin's implementation), it seems like this was the simplest solution, as
there's no interface on the `SlideFilterModel` class for swapping specific
items:
https://invent.kde.org/plasma/plasma-workspace/-/blob/v6.4.90/wallpapers/image/plugin/slidefiltermodel.h#L17

Alternatively, the slideshow could be reshuffled again until the first item is
not the previous one, but this of course doesn't work in constant time.

STEPS TO REPRODUCE
Have a wallpaper image slideshow in random order with at least 3 items

OBSERVED RESULT
Current slideshow:
A B C
Potential next slideshows:
A B C
A C B
B A C
B C A
A B (C was skipped)
B A (C was skipped)

EXPECTED RESULT
Current slideshow:
A B C
Potential next slideshows:
A B C
A C B
B A C
B C A
A C B (via C A B)
B A C (via C A B)
B C A (via C B A)
A B C (via C B A)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to