background: always add content to cache

We currently only add the first instance of a background
to the cache.  This means if the actor associated with that
background is destroyed, the content will be evicted and
it will need to get reloaded, even if it's already loaded
on another actor.

This commit ensures every content gets added to the cache.

https://bugzilla.gnome.org/show_bug.cgi?id=696157
This commit is contained in:
Ray Strode 2013-03-22 15:01:29 -04:00
parent cab092aad7
commit 3be489c69e

View File

@ -84,9 +84,9 @@ const BackgroundCache = new Lang.Class({
} else { } else {
content.load_gradient(params.shadingType, params.color, params.secondColor); content.load_gradient(params.shadingType, params.color, params.secondColor);
} }
}
this._patterns.push(content); this._patterns.push(content);
}
return content; return content;
}, },
@ -165,6 +165,8 @@ const BackgroundCache = new Lang.Class({
if (params.cancellable && params.cancellable.is_cancelled()) if (params.cancellable && params.cancellable.is_cancelled())
content = null; content = null;
else
this._images.push(content);
if (params.onFinished) if (params.onFinished)
params.onFinished(content); params.onFinished(content);