Skip to content

Wallpaper picker shows duplicate entries due to symlinks to same files #3578

@jernej-9

Description

@jernej-9

COSMIC Settings displays the same wallpaper image multiple times in the wallpaper picker because it follows symbolic links that ultimately resolve to the same file.

For example, this problem is happening on a clean installation of Fedora, which creates the following file structure in /usr/share/backgrounds/ with several symbolic links pointing to the same underlying images:

$ tree /usr/share/backgrounds/
/usr/share/backgrounds/
├── cosmic
│   ├── A_stormy_stellar_nursery_esa_379309.jpg
│   ├── orion_nebula_nasa_heic0601a.jpg
│   ├── otherworldly_earth_nasa_ISS064-E-29444.jpg
│   ├── phytoplankton_bloom_nasa_oli2_20240121.jpg
│   ├── round_moons_nasa.jpg
│   ├── tarantula_nebula_nasa_PIA23646.jpg
│   └── webb-inspired-wallpaper-system76.jpg
├── default-dark.jxl -> ./f43/default/f43-01-night.jxl
├── default.jxl -> ./f43/default/f43-01-day.jxl
├── default.xml -> f43/default/f43.xml
├── f43
│   └── default
│       ├── f43-01-day.jxl
│       ├── f43-01-night.jxl
│       └── f43.xml
└── images
    ├── default-16_10.jxl -> ../f43/default/f43-01-day.jxl
    ├── default-16_9.jxl -> ../f43/default/f43-01-day.jxl
    ├── default-5_4.jxl -> ../f43/default/f43-01-day.jxl
    ├── default-dark-16_10.jxl -> ../f43/default/f43-01-night.jxl
    ├── default-dark-16_9.jxl -> ../f43/default/f43-01-night.jxl
    ├── default-dark-5_4.jxl -> ../f43/default/f43-01-night.jxl
    ├── default-dark.jxl -> ../f43/default/f43-01-night.jxl
    └── default.jxl -> ../f43/default/f43-01-day.jxl

5 directories, 21 files

As evident in the screenshot below, due to the symbolic links, the same image is displayed in the wallpaper picker multiple times.
I would assume this is happening since pop-os/cosmic-settings#1960.

Steps to reproduce the behavior:

  1. Clean install of Fedora
  2. Open COSMIC Settings -> Desktop -> Wallpaper

Expected behavior
Symbolic link resolution should be kept in my opinion, also to accommodate other use cases (e.g. the one described in pop-os/cosmic-settings#1960 (comment)), but the final list of images to be shown should be de-duplicated to avoid the problem seen here.

Screenshots
Image

Desktop:

  • OS: Fedora 43
  • COSMIC version: 1.0.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions