background: destroy actors don't remove them from their parent

This reads better, and it also fixes a warning when background
is changed while transitioning to the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=694227
This commit is contained in:
Ray Strode 2013-02-19 21:50:40 -05:00
parent 34443da7ab
commit dcacbb37c3

View File

@ -664,16 +664,12 @@ const BackgroundManager = new Lang.Class({
this.background.disconnect(this._changedSignalId); this.background.disconnect(this._changedSignalId);
if (this._newBackground) { if (this._newBackground) {
let container = this._newBackground.actor.get_parent(); this._newBackground.actor.destroy();
if (container)
container.remove_actor(this._newBackground.actor);
this._newBackground = null; this._newBackground = null;
} }
if (this.background) { if (this.background) {
let container = this.background.actor.get_parent(); this.background.actor.destroy();
if (container)
container.remove_actor(this.background.actor);
this.background = null; this.background = null;
} }
}, },
@ -695,7 +691,7 @@ const BackgroundManager = new Lang.Class({
onComplete: Lang.bind(this, function() { onComplete: Lang.bind(this, function() {
this.background = newBackground; this.background = newBackground;
this._newBackground = null; this._newBackground = null;
this._container.remove_actor(background.actor); background.actor.destroy();
this.emit('changed'); this.emit('changed');
}) })
}); });