[gnome-shell] BackgroundManager: don't destroy the newly created actor



commit 816f5162f96d5af2f4af21c028cad09297ab9b2b
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Jan 22 20:17:15 2014 +0100

    BackgroundManager: don't destroy the newly created actor
    
    Because we were setting this.background before calling .destroy(),
    the call that was meant to destroy the old background was actually
    destroying the new one!
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722787

 js/ui/background.js |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index f4d486c..3a7541c 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -748,14 +748,16 @@ const BackgroundManager = new Lang.Class({
                                    time: FADE_ANIMATION_TIME,
                                    transition: 'easeOutQuad',
                                    onComplete: Lang.bind(this, function() {
-                                       if (this._newBackground == newBackground) {
-                                           this.background = newBackground;
-                                           this._newBackground = null;
-                                       } else {
+                                       if (this._newBackground != newBackground) {
+                                           /* Not interesting, we queued another load */
                                            newBackground.actor.destroy();
+                                           return;
                                        }
 
                                        this.background.actor.destroy();
+                                       this.background = newBackground;
+                                       this._newBackground = null;
+
                                        this.emit('changed');
                                    })
                                  });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]