switchboard-plug-pantheon-shell icon indicating copy to clipboard operation
switchboard-plug-pantheon-shell copied to clipboard

wallpaper slideshow: transition animation won't work?

Open bobby285271 opened this issue 3 years ago • 0 comments

What Happened?

Not really an issue I guess, just posting this for fun :-)

When you select multiple images in elementary-files and set them as wallpaper in the right click menu, this package will generate a ~/.local/share/backgrounds/slideshow.xml for you and use it as wallpaper source:

$ gsettings get org.gnome.desktop.background picture-uri
'file:///home/bobby285271/.local/share/backgrounds/slideshow.xml'

However you will find the <transition> section weird, the <from> section is always the same as the <to> section:

<transition>
    <duration>1</duration>
    <from>/home/bobby285271/.local/share/backgrounds/2023-02-23-19-18-48-foo.jpg</from>
    <to>/home/bobby285271/.local/share/backgrounds/2023-02-23-19-18-48-foo.jpg</to>
</transition>

Later I found out that it is some typo that causes this, here the index used for next_slide is probably wrong:

https://github.com/elementary/switchboard-plug-pantheon-shell/blob/d3415daef6240c7cfc93208c079ce31c8f228334/set-wallpaper-contract/set-wallpaper.vala#L49-L58

Fixing should be something like:

-            var next_slide = files.nth_data (i - 1 == len ? 0 : i).get_path ();
+            var next_slide = files.nth_data ((i + 1) % len).get_path ();

I almost filed a PR, but I soon found a gnome-shell issue saying animated background is choppy in short transitions and unfortunately I found it applies to gala too (because gala and gnome-shell calculates interval in exactly the same way):

https://github.com/elementary/gala/blob/7.0.0/src/Background/Background.vala#L20-L21

And we are hardcoding the transition duration as 1s:

https://github.com/elementary/switchboard-plug-pantheon-shell/blob/d3415daef6240c7cfc93208c079ce31c8f228334/set-wallpaper-contract/set-wallpaper.vala#L21

So I wonder if we want to fix the transition animation, probably no animation is better than a choppy one?

Steps to Reproduce

  1. Open elementary-files
  2. Select multiple images
  3. Right click - set as desktop background
  4. Set a duration (probably just set it as 5 seconds)
  5. Wait for 5 seconds and see no animation when the wallpaper changes
  6. cat ~/.local/share/backgrounds/slideshow.xml

Expected Behavior

Not sure what the expected behavior is, but maybe at least a typo is in this repo right now?

OS Version

Other Linux

Software Version

Compiled from git

Log Output

No response

Hardware Info

No response

bobby285271 avatar Feb 23 '23 13:02 bobby285271