[gnome-shell] background: always copy background content when loading into cache
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] background: always copy background content when loading into cache
- Date: Wed, 12 Mar 2014 16:40:07 +0000 (UTC)
commit ec6facb9e76c916b3faa78af568424694c8da133
Author: Ray Strode <rstrode redhat com>
Date: Wed Feb 26 14:35:38 2014 -0500
background: always copy background content when loading into cache
Copying is actually a lightweight operation, so trying to avoid it just adds
code complexity for little gain.
Based on work from Jasper St. Pierre <jstpierre macheye net>
https://bugzilla.gnome.org/show_bug.cgi?id=722149
js/ui/background.js | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 3a7541c..3fe279d 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -143,8 +143,7 @@ const BackgroundCache = new Lang.Class({
for (let i = 0; i < this._pendingFileLoads.length; i++) {
if (this._pendingFileLoads[i].filename == params.filename &&
this._pendingFileLoads[i].style == params.style) {
- this._pendingFileLoads[i].callers.push({ shouldCopy: true,
- monitorIndex: params.monitorIndex,
+ this._pendingFileLoads[i].callers.push({ monitorIndex: params.monitorIndex,
effects: params.effects,
onFinished: params.onFinished });
return;
@@ -153,14 +152,11 @@ const BackgroundCache = new Lang.Class({
this._pendingFileLoads.push({ filename: params.filename,
style: params.style,
- callers: [{ shouldCopy: false,
- monitorIndex: params.monitorIndex,
+ callers: [{ monitorIndex: params.monitorIndex,
effects: params.effects,
onFinished: params.onFinished }] });
- let content = new Meta.Background({ meta_screen: global.screen,
- monitor: params.monitorIndex,
- effects: params.effects });
+ let content = new Meta.Background({ meta_screen: global.screen });
content.load_file_async(params.filename,
params.style,
@@ -171,7 +167,6 @@ const BackgroundCache = new Lang.Class({
content.load_file_finish(result);
this._monitorFile(params.filename);
- this._images.push(content);
} catch(e) {
content = null;
}
@@ -186,12 +181,10 @@ const BackgroundCache = new Lang.Class({
if (pendingLoad.callers[j].onFinished) {
let newContent;
- if (content && pendingLoad.callers[j].shouldCopy) {
+ if (content) {
newContent =
content.copy(pendingLoad.callers[j].monitorIndex,
pendingLoad.callers[j].effects);
this._images.push(newContent);
- } else {
- newContent = content;
}
pendingLoad.callers[j].onFinished(newContent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]