From 668128f8c9928fe1fed950cb2b643aa0d49a41e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 31 Jul 2019 14:54:56 +0200 Subject: [PATCH] lightbox: Remove previously added tweens from target Since commit 007d30573 we use an actor effect to apply the radial effect and we pass the effect to the tweener in order to animate it. However, we always still remove the previously added tween from the actor, instead that from the actual target. So, depending the radial effect state, remove the tweens from the proper target https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/653 --- js/ui/lightbox.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/js/ui/lightbox.js b/js/ui/lightbox.js index 18a309997..48c329e95 100644 --- a/js/ui/lightbox.js +++ b/js/ui/lightbox.js @@ -154,9 +154,10 @@ var Lightbox = class Lightbox { show(fadeInTime) { fadeInTime = fadeInTime || 0; - Tweener.removeTweens(this.actor); if (this._radialEffect) { - Tweener.addTween(this.actor.get_effect('radial'), + let effect = this.actor.get_effect('radial'); + Tweener.removeTweens(effect); + Tweener.addTween(effect, { brightness: VIGNETTE_BRIGHTNESS, vignetteSharpness: VIGNETTE_SHARPNESS, time: fadeInTime, @@ -167,6 +168,7 @@ var Lightbox = class Lightbox { } }); } else { + Tweener.removeTweens(this.actor); Tweener.addTween(this.actor, { opacity: 255 * this._fadeFactor, time: fadeInTime, @@ -185,9 +187,11 @@ var Lightbox = class Lightbox { fadeOutTime = fadeOutTime || 0; this.shown = false; - Tweener.removeTweens(this.actor); + if (this._radialEffect) { - Tweener.addTween(this.actor.get_effect('radial'), + let effect = this.actor.get_effect('radial'); + Tweener.removeTweens(effect); + Tweener.addTween(effect, { brightness: 1.0, vignetteSharpness: 0.0, opacity: 0, @@ -198,6 +202,7 @@ var Lightbox = class Lightbox { } }); } else { + Tweener.removeTweens(this.actor); Tweener.addTween(this.actor, { opacity: 0, time: fadeOutTime,