[gnome-shell] background: Don't wait for gdk-pixbuf to fail before loading animations



commit eb1c85f3f5503d3778a935295e625c27947bfe40
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Dec 3 15:56:12 2013 -0500

    background: Don't wait for gdk-pixbuf to fail before loading animations
    
    We don't have any better way of determining whether something is a slideshow
    animation, so discriminate on the .xml filename instead of waiting for
    gdk-pixbuf to determine whether it can load a file or not.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719803

 js/ui/background.js |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 0a21bd2..5f11e57 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -536,24 +536,25 @@ const Background = new Lang.Class({
                                            });
     },
 
-    _loadFile: function(filename) {
+    _loadImage: function(filename) {
         this._cache.getImageContent({ monitorIndex: this._monitorIndex,
                                       effects: this._effects,
                                       style: this._style,
                                       filename: filename,
                                       cancellable: this._cancellable,
                                       onFinished: Lang.bind(this, function(content) {
-                                          if (!content) {
-                                              if (!this._cancellable.is_cancelled())
-                                                  this._loadAnimation(filename);
-                                              return;
-                                          }
-
-                                          this._addImage(content, 0, filename);
+                                          if (content)
+                                              this._addImage(content, 0, filename);
                                           this._setLoaded();
                                       })
                                     });
+    },
 
+    _loadFile: function(filename) {
+        if (filename.endsWith('.xml'))
+            this._loadAnimation(filename);
+        else
+            this._loadImage(filename);
     },
 
     _load: function () {


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