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

wallpaper slideshow: transition animation won't work? #340

Open
bobby285271 opened this issue Feb 23, 2023 · 0 comments
Open

wallpaper slideshow: transition animation won't work? #340

bobby285271 opened this issue Feb 23, 2023 · 0 comments
Labels
Status: Confirmed Reproducible or confirmed by someone other than the reporter

Comments

@bobby285271
Copy link
Member

bobby285271 commented Feb 23, 2023

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:

private void update_slideshow (string path, List<File> files, int duration) {
var wallpapers = "";
var len = files.length ();
for (var i = 0; i < len; i++) {
var slide = files.nth_data (i).get_path ();
var next_slide = files.nth_data (i - 1 == len ? 0 : i).get_path ();
wallpapers += SLIDESHOW_WALLPAPER_TEMPLATE.printf (duration, slide,
DEFAULT_TRANSITION_DURATION, slide, next_slide);
}

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:

const int DEFAULT_TRANSITION_DURATION = 1;

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

@lenemter lenemter added the Status: Confirmed Reproducible or confirmed by someone other than the reporter label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Confirmed Reproducible or confirmed by someone other than the reporter
Projects
None yet
Development

No branches or pull requests

2 participants