Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No backgrounds shown with system backgrounds dir has subdirectories #246

Open
2 of 3 tasks
worldofpeace opened this issue Oct 12, 2020 · 3 comments
Open
2 of 3 tasks

Comments

@worldofpeace
Copy link
Contributor

worldofpeace commented Oct 12, 2020

Prerequisites

  • I have searched open and closed issues for duplicates.

I recalled #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 NixOS/nixpkgs#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

/run/current-system/sw/share/backgrounds
  nixos/
  ...bunch of elementary wallpapers

From the output there seems to be nothing of importance.

To Reproduce

Steps to reproduce the behavior:

  1. At your system background directory $XDG_DATA_DIRS/share/backgrounds have a subdirectory with pictures in it
  2. Click on Wallpapers
  3. Just a black background
  4. Now delete that subdirectory and repeat. It's magic and now the wallpapers are there.

I 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

Screenshot from 2020-10-07 15-38-20

Platform Information

OS: NixOS
OS Version: NixOS 20.09 and 21.03-pre-git

  • I'm using the latest version from git that I've manually compiled
  • I'm using the latest released stable version

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@worldofpeace
Copy link
Contributor Author

I almost want to make a regression test for this, but I don't see any status quo of regression tests in elementary projects.

@worldofpeace worldofpeace changed the title No backgrounds shown with subdirectories No backgrounds shown with system backgrounds dir has subdirectories Oct 12, 2020
@worldofpeace
Copy link
Contributor Author

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 worldofpeace@4c8fb15

These are the scenarios I tested and their results:

  • backgrounds-no-subdir ✔️ (meaning just only the wallpapers from elementary-wallpapers)
  • backgrounds-one-subdir ✔️
  • backgrounds-two-subdirs 🔴
  • backgrounds-with-subdir-photos-in-parent 🔴
  • backgrounds-with-subdirs-photos-in-parent 🔴

✔️ == success, I see wallpapers in the view
🔴 == 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/

@worldofpeace
Copy link
Contributor Author

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.

worldofpeace added a commit to NixOS/nixpkgs that referenced this issue Oct 26, 2020
This reverts commit 5100e4f.

Fixes #100293
Though it's only a workaround for now.
See elementary/switchboard-plug-pantheon-shell#246 (comment)
We trigger the broken scenario where we have two subdirectories. Reverting
that commit undoes this.
worldofpeace added a commit to NixOS/nixpkgs that referenced this issue Oct 26, 2020
This reverts commit 5100e4f.

Fixes #100293
Though it's only a workaround for now.
See elementary/switchboard-plug-pantheon-shell#246 (comment)
We trigger the broken scenario where we have two subdirectories. Reverting
that commit undoes this.

(cherry picked from commit ace69f7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant