Animated background is choppy in short transitions
GNOME Shell smooth background animations
Feature summary
The animated backgrounds that GNOME Shell supports in XML format are designed so that crossfaded transitions happen in a very long time; the default example (adwaita-timed.xml
) uses transitions of several hours (the shortest is 2 hours).
If you try to make a short transition (a couple of seconds), so the background effectively works as a slide presentation, the resulting animation is jarringly choppy:
However, it is relatively easy to make the animation smooth:
(Please ignore the glitches in the videos; those are caused by the recording software.)
To achieve smooth transitions, only two values need to be changed in js/ui/background.js
from
var ANIMATION_OPACITY_STEP_INCREMENT = 4.0;
var ANIMATION_MIN_WAKEUP_INTERVAL = 1.0;
to
var ANIMATION_OPACITY_STEP_INCREMENT = 0.5;
var ANIMATION_MIN_WAKEUP_INTERVAL = 0.01;
Those values are extreme, I'm sure; I arrived at them through quick experimentation, but I'm sure more sensible values would also allow smooth animations.
I know that reducing the opacity step increment and the wake up interval results in more wasted clock cycles (which perhaps will result in less battery time and some performance loss; although I haven't noticed any myself), and it would be useless in hours long transitions. However, a (possibly hidden) setting could be used to allow smooth transitions for users (like me) that want to use their desktop background as an endless slide presentation.
How would you like it to work
A hidden boolean setting, perhaps exposed through GNOME Tweaks, simply called Smooth transitions; when the users sets it to true
, the opacity step increment and the wake up interval are significantly reduced. The UI and setting comments should warn about the possible loss in performance and battery time.
If there is interest, I could try to implement it myself.
Relevant links, screenshots, screencasts etc.
Provided in the Feature summary.