[gnome-shell] NotificationDaemon: fix icons for notifications without an app



commit 619389ed201632d2d8a757f2068c99e33a50fb35
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Oct 12 18:50:49 2013 +0200

    NotificationDaemon: fix icons for notifications without an app
    
    NotificationDaemon doesn't pass a gicon to the Notification constructor,
    because it calls .update() immediately after, so messageTray.js
    calls into Source.createIcon(), which returns null and crashes.
    Instead, shortcut the Notification constructor by skipping
    .update() completely.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709998

 js/ui/messageTray.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index d8d1e36..d75a5a9 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -438,7 +438,12 @@ const Notification = new Lang.Class({
         this._bannerLabel = this._bannerUrlHighlighter.actor;
         this._bannerBox.add_actor(this._bannerLabel);
 
-        this.update(title, banner, params);
+        // If called with only one argument we assume the caller
+        // will call .update() later on. This is the case of
+        // NotificationDaemon, which wants to use the same code
+        // for new and updated notifications
+        if (arguments.length != 1)
+            this.update(title, banner, params);
     },
 
     // update:


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