From 5fecd07045e1c8571194f526bbf62cd2a4b7021c Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 14 Mar 2013 16:58:52 -0400 Subject: [PATCH] background: Look at the duration per-step We need to look at the duration of the current step of the slideshow to determine when to next queue an event, rather than the full slideshow duration. https://bugzilla.gnome.org/show_bug.cgi?id=695882 --- js/ui/background.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/ui/background.js b/js/ui/background.js index bfe06a526..0672dd14e 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -440,11 +440,11 @@ const Background = new Lang.Class({ if (!this._cancellable || this._cancellable.is_cancelled()) return; - if (!this._animation.duration) + if (!this._animation.transitionDuration) return; let nSteps = 255 / ANIMATION_OPACITY_STEP_INCREMENT; - let timePerStep = (this._animation.duration * 1000) / nSteps; + let timePerStep = (this._animation.transitionDuration * 1000) / nSteps; let interval = Math.max(ANIMATION_MIN_WAKEUP_INTERVAL * 1000, timePerStep); @@ -591,8 +591,8 @@ const Animation = new Lang.Class({ this.filename = params.filename; this.keyFrameFiles = []; - this.duration = 0.0; this.transitionProgress = 0.0; + this.transitionDuration = 0.0; this.loaded = false; }, @@ -604,7 +604,6 @@ const Animation = new Lang.Class({ this._show.load_async(null, Lang.bind(this, function(object, result) { - this.duration = this._show.get_total_duration(); this.loaded = true; if (callback) callback(); @@ -622,6 +621,7 @@ const Animation = new Lang.Class({ let [progress, duration, isFixed, file1, file2] = this._show.get_current_slide(monitor.width, monitor.height); + this.transitionDuration = duration; this.transitionProgress = progress; if (file1)