pop-os / cosmic-settings

COSMIC Settings
GNU General Public License v3.0
164 stars 109 forks source link

[BUG]: Cosmic background "same wallpaper on all displays" does not work. #720

Open l-const opened 3 weeks ago

l-const commented 3 weeks ago

I believe only one of the two states from the logs is correct, it is the second one. Closing and re-opening the settings window app , is resetting state due to self.outputs.clear() on Message::Init(_) , nevertheless there is a need of _last_pickedbackground state variable or applying the _defaultbackground assuming it is the last to both entries when there is a change on the same_on_all: true property

cosmic-bg logs:

-------------------------------------------------------------

  DEBUG  new state, same_on_all: true, outputs: {}, backgrounds: [Entry { output: "DP-4", source: Path("/usr/share/backgrounds/f40/default/f40-01-day.png"), filter_by_theme: false, rotation_frequency: 300, filter_method: Lanczos, scaling_mode: Fit([0.0, 0.0, 0.0]), sampling_method: Alphanumeric }, Entry { output: "HDMI-A-3", source: Path("/usr/share/backgrounds/f38/default/f38-01-night.png"), filter_by_theme: false, rotation_frequency: 300, filter_method: Lanczos, scaling_mode: Fit([0.0, 0.0, 0.0]), sampling_method: Alphanumeric }], default_background: Path("/usr/share/backgrounds/f38/default/f38-01-day.png")
    at src/main.rs:158 on main

  DEBUG  wallpaper draw, elapsed: 247.540556ms, source: Path("/usr/share/backgrounds/f38/default/f38-01-night.png")
    at src/wallpaper.rs:221 on main

  DEBUG  wallpaper draw, elapsed: 367.01702ms, source: Path("/usr/share/backgrounds/f40/default/f40-01-day.png")
    at src/wallpaper.rs:221 on main

  DEBUG  updating backgrounds
    at src/main.rs:108 on main

  DEBUG  loading images, source: "/usr/share/backgrounds/f38/default/f38-01-day.png"
    at src/wallpaper.rs:236 on main

  DEBUG  watching source, output: "all"
    at src/wallpaper.rs:325 on main

------------------------------------------------
----------------------------------------------

  DEBUG  new state, same_on_all: true, outputs: {}, backgrounds: [], default_background: Path("/usr/share/backgrounds/f38/default/f38-01-day.png")
    at src/main.rs:158 on main

  DEBUG  wallpaper draw, elapsed: 266.536975ms, source: Path("/usr/share/backgrounds/f38/default/f38-01-day.png")
    at src/wallpaper.rs:221 on main

  DEBUG  wallpaper draw, elapsed: 213.20953ms, source: Path("/usr/share/backgrounds/f38/default/f38-01-day.png")
    at src/wallpaper.rs:221 on main

This is the same issue with : pop-os/cosmic-bg#61

but I believe this should be handled here as cosmic-settings is the one that updates the config files

An example:

screenshot-2024-10-23-19-50-44

States comparison:

DEBUG  new state, same_on_all: true, outputs: {}, backgrounds: [Entry { output: "DP-4", source: Path("/usr/share/backgrounds/f40/default/f40-01-day.png"), filter_by_theme: false, rotation_frequency: 300, filter_method: Lanczos, scaling_mode: Fit([0.0, 0.0, 0.0]), sampling_method: Alphanumeric }, Entry { output: "HDMI-A-3",

vs.

  DEBUG  new state, same_on_all: true, outputs: {}, backgrounds: [], default_background: Path("/usr/share/backgrounds/f38/default/f38-01-day.png")

only the second one works correctly, but you can eventually reach the first one within a single app session by doing all the possible transitions , changing in more than one the wallpapers for different monitors and then choose again apply the wallpapers to all displays/outputs.

l-const commented 3 weeks ago

I might work on this the following days if it is not a priority to be picked up from someone else.