r44041 - in /desktop/unstable/gnome-shell/debian: changelog patches/10_background_race.patch patches/series

joss at users.alioth.debian.org joss at users.alioth.debian.org
Fri Dec 12 20:20:37 UTC 2014


Author: joss
Date: Fri Dec 12 20:20:37 2014
New Revision: 44041

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=44041
Log:
10_background_race.patch: fix a race condition when loading two 
backgrounds made of different XML files.

Added:
    desktop/unstable/gnome-shell/debian/patches/10_background_race.patch
Modified:
    desktop/unstable/gnome-shell/debian/changelog
    desktop/unstable/gnome-shell/debian/patches/series

Modified: desktop/unstable/gnome-shell/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/changelog?rev=44041&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/changelog	[utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/changelog	[utf-8] Fri Dec 12 20:20:37 2014
@@ -1,8 +1,10 @@
 gnome-shell (3.14.2-3) UNRELEASED; urgency=medium
 
   * Add missing dependency on mutter. Closes: #764715.
-
- -- Josselin Mouette <joss at debian.org>  Wed, 10 Dec 2014 10:06:54 +0100
+  * 10_background_race.patch: fix a race condition when loading two 
+    backgrounds made of different XML files.
+
+ -- Josselin Mouette <joss at debian.org>  Fri, 12 Dec 2014 20:22:45 +0100
 
 gnome-shell (3.14.2-2) unstable; urgency=medium
 

Added: desktop/unstable/gnome-shell/debian/patches/10_background_race.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/10_background_race.patch?rev=44041&op=file
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/10_background_race.patch	(added)
+++ desktop/unstable/gnome-shell/debian/patches/10_background_race.patch	[utf-8] Fri Dec 12 20:20:37 2014
@@ -0,0 +1,70 @@
+From 336edc63685410e9058743b65152576317b08fed Mon Sep 17 00:00:00 2001
+From: Josselin Mouette <joss at debian.org>
+Date: Fri, 12 Dec 2014 21:10:48 +0100
+Subject: [PATCH] background: fix a race condition when loading several
+ animations
+
+When loading several animations at the same time, the last call
+overrides the result for all of them.
+
+This commit caches all animations separately based on filename.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=741453
+---
+ js/ui/background.js | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/js/ui/background.js b/js/ui/background.js
+index ad0cacc..ad75c65 100644
+--- a/js/ui/background.js
++++ b/js/ui/background.js
+@@ -134,6 +134,7 @@ const BackgroundCache = new Lang.Class({
+         this._pendingFileLoads = [];
+         this._fileMonitors = {};
+         this._backgroundSources = {};
++        this._animations = {};
+     },
+ 
+     monitorFile: function(filename) {
+@@ -152,12 +153,13 @@ const BackgroundCache = new Lang.Class({
+ 
+     getAnimation: function(params) {
+         params = Params.parse(params, { filename: null,
++                                        settingsSchema: null,
+                                         onLoaded: null });
+ 
+-        if (this._animationFilename == params.filename) {
++        if (this._animations[params.settingsSchema] && this._animations[params.settingsSchema].filename == params.filename) {
+             if (params.onLoaded) {
+                 let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
+-                    params.onLoaded(this._animation);
++                    params.onLoaded(this._animations[params.settingsSchema]);
+                     return GLib.SOURCE_REMOVE;
+                 }));
+                 GLib.Source.set_name_by_id(id, '[gnome-shell] params.onLoaded');
+@@ -168,12 +170,11 @@ const BackgroundCache = new Lang.Class({
+         let animation = new Animation({ filename: params.filename });
+ 
+         animation.load(Lang.bind(this, function() {
+-                           this._animationFilename = params.filename;
+-                           this._animation = animation;
++                           this._animations[params.settingsSchema] = animation;
+ 
+                            if (params.onLoaded) {
+                                let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
+-                                   params.onLoaded(this._animation);
++                                   params.onLoaded(this._animations[params.settingsSchema]);
+                                    return GLib.SOURCE_REMOVE;
+                                }));
+                                GLib.Source.set_name_by_id(id, '[gnome-shell] params.onLoaded');
+@@ -392,6 +393,7 @@ const Background = new Lang.Class({
+ 
+     _loadAnimation: function(filename) {
+         this._cache.getAnimation({ filename: filename,
++                                   settingsSchema: this._settings.schema_id,
+                                              onLoaded: Lang.bind(this, function(animation) {
+                                                  this._animation = animation;
+ 
+-- 
+2.1.3
+

Modified: desktop/unstable/gnome-shell/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/series?rev=44041&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/series	[utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/patches/series	[utf-8] Fri Dec 12 20:20:37 2014
@@ -1,6 +1,7 @@
 01_network_list.patch
 02_auth_prompt.patch
 #10-make-NetworkManager-optional.patch
+10_background_race.patch
 27-nm-libexec-path.patch
 #30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch
 41-handle-logind-fail.patch




More information about the pkg-gnome-commits mailing list