Open worldofpeace opened 3 years ago
I almost want to make a regression test for this, but I don't see any status quo of regression tests in elementary projects.
I looked into bisecting this and realized there's some scenarios I need to test to make sure I could exactly reproduce this. As there's no testing framework for this I had to hack stuff together with nix and to run it manually, but it works pretty nicely to construct and hardcode the backgrounds directory so we don't rely on global state for testing purposes https://github.com/worldofpeace/switchboard-plug-pantheon-shell/commit/4c8fb1508834e2e69d21f71996413da448a30767
These are the scenarios I tested and their results:
:heavy_check_mark: == success, I see wallpapers in the view :red_circle: == fail, I don't see any wallpapers in view
(note I am now testing right off that branch and on master)
To illustrate, this means permutations of the following filesystem layouts don't work
# backgrounds-two-subdirs
backgrounds/
elementary/
nixos/
# backgrounds-with-subdir-photos-in-parent
backgrounds/
photo1,photo2
nixos/
# backgrounds-with-subdirs-photos-in-parent
backgrounds/
photo1,photo2
nixos/
elementary/
Obviously the bug lies in https://github.com/elementary/switchboard-plug-pantheon-shell/blob/master/src/Views/Wallpaper.vala#L327, I just need to add some debug output so I can see what conditional logic it's jumping into in the three failing scenarios.
Prerequisites
I recalled https://github.com/elementary/switchboard-plug-pantheon-shell/issues/157 but that issue was fixed and there's been no
new_for_path
->new_for_uri
Describe the bug
This has been reported on NixOS https://github.com/NixOS/nixpkgs/issues/100293. If there's subdirectories at the system backgrounds directory no wallpapers are loaded from there.
The layout of the system backgrounds directory would be like
From the output there seems to be nothing of importance.
To Reproduce
Steps to reproduce the behavior:
$XDG_DATA_DIRS/share/backgrounds
have a subdirectory with pictures in itI actually did this with no local backgrounds btw.
Expected behavior
It doesn't matter what directory structure at the backgrounds directory is, everything that is an image is loaded.
Screenshots or screen recordings
Platform Information
OS: NixOS OS Version: NixOS 20.09 and 21.03-pre-git