[gnome-shell] tweener: remove tweens when target.actor is destroyed
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] tweener: remove tweens when target.actor is destroyed
- Date: Tue, 22 Feb 2011 17:37:03 +0000 (UTC)
commit 192d3a94edebbd497a4aa445da76eb73933d627c
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Tue Feb 22 09:25:48 2011 -0500
tweener: remove tweens when target.actor is destroyed
We already remove tweens automatically when a Clutter actor is destroyed;
do the same when the target is a JS delegate with an actor property.
https://bugzilla.gnome.org/show_bug.cgi?id=642925
js/ui/tweener.js | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/tweener.js b/js/ui/tweener.js
index 685f4b3..8a633bd 100644
--- a/js/ui/tweener.js
+++ b/js/ui/tweener.js
@@ -62,9 +62,16 @@ function addTween(target, tweeningParameters) {
function _wrapTweening(target, tweeningParameters) {
let state = _getTweenState(target);
- if (target instanceof Clutter.Actor && !state.destroyedId)
- state.destroyedId = target.connect('destroy', _actorDestroyed);
-
+ if (!state.destroyedId) {
+ if (target instanceof Clutter.Actor) {
+ state.actor = target;
+ state.destroyedId = target.connect('destroy', _actorDestroyed);
+ } else if (target.actor && target.actor instanceof Clutter.Actor) {
+ state.actor = target.actor;
+ state.destroyedId = target.actor.connect('destroy', function() { _actorDestroyed(target); });
+ }
+ }
+
_addHandler(target, tweeningParameters, 'onStart', _tweenStarted);
_addHandler(target, tweeningParameters, 'onComplete', _tweenCompleted);
}
@@ -82,7 +89,7 @@ function _resetTweenState(target) {
if (state) {
if (state.destroyedId)
- target.disconnect(state.destroyedId);
+ state.actor.disconnect(state.destroyedId);
if (state.idleCompletedId)
Mainloop.source_remove(state.idleCompletedId);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]