You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've found an issue with random sorting (both grouped and ungrouped). The function update_current_image in daemon/image_picker.rs does not correctly push new random wallpapers to the queue in some scenarios (e.g., when wallpapers from the folder are not picked sequentially, such as 0,1,2,...).
In the following video, this behavior can be observed. The bitrate is awful, and my terminal isn't transparent enough for a clear view of the background, but you can still see the wallpaper change at the top.
In this video wallpapers are randomly picked in order (0: FoggyRoad, 1: Gray, 2: HardDisk) and correctly added to the queue:
Here everything works as expected: 3 wallpapers are randomly picked one after the other and correctly added to the queue. Subsequent calls correctly assign a new random wallpaper, and wpapperd never gets stuck.
In the following video, I wasn't as "lucky". The first wallpaper picked is the one with index 1 (Gray), which is correctly added to the queue. The next randomly chosen wallpaper is the one with index 0 (FoggyRoad), which is correctly displayed but not added to the queue. On the next request, wpapperd gets stuck.
As you can see in the terminal, the transitions from the old wallpaper to the new wallpaper and the current queue elements are displayed. These are printed by update_current_image function in daemon/image_picker.rs. The code is as follows:
As far as I understand, this issue is caused by this if statement, which is responsible for adding images to the queue and is present for both GroupedRandom and Random sorting:
if queue.has_reached_end() || queue.buffer.get(index).is_none(){
queue.push(img_path.clone());}
Without this if statement, this issue does not occur, and random sorting works as expected. The queue does not contain duplicates, thanks to a duplicate prevention check in the push function. However, I don't clearly understand why those checks are there and what their purpose is; maybe I'm missing something, and their removal could cause unintended behaviors.
The text was updated successfully, but these errors were encountered:
Hi, I've found an issue with random sorting (both grouped and ungrouped). The function
update_current_image
indaemon/image_picker.rs
does not correctly push new random wallpapers to the queue in some scenarios (e.g., when wallpapers from the folder are not picked sequentially, such as 0,1,2,...).In the following video, this behavior can be observed. The bitrate is awful, and my terminal isn't transparent enough for a clear view of the background, but you can still see the wallpaper change at the top.
In this video wallpapers are randomly picked in order (0: FoggyRoad, 1: Gray, 2: HardDisk) and correctly added to the queue:
https://drive.google.com/file/d/1-HqrxHUSlugL-ywoyAQ4D5UZE-fq_p_9/view?usp=drive_link
Here everything works as expected: 3 wallpapers are randomly picked one after the other and correctly added to the queue. Subsequent calls correctly assign a new random wallpaper, and wpapperd never gets stuck.
In the following video, I wasn't as "lucky". The first wallpaper picked is the one with index 1 (Gray), which is correctly added to the queue. The next randomly chosen wallpaper is the one with index 0 (FoggyRoad), which is correctly displayed but not added to the queue. On the next request, wpapperd gets stuck.
https://drive.google.com/file/d/1vDRT-aOMHPdkDEGFLCBzevZw-D0xum18/view?usp=drive_link
As you can see in the terminal, the transitions from the old wallpaper to the new wallpaper and the current queue elements are displayed. These are printed by
update_current_image
function indaemon/image_picker.rs
. The code is as follows:As far as I understand, this issue is caused by this
if
statement, which is responsible for adding images to the queue and is present for bothGroupedRandom
andRandom
sorting:Without this
if
statement, this issue does not occur, and random sorting works as expected. The queue does not contain duplicates, thanks to a duplicate prevention check in the push function. However, I don't clearly understand why those checks are there and what their purpose is; maybe I'm missing something, and their removal could cause unintended behaviors.The text was updated successfully, but these errors were encountered: