[banshee] [NotificationAreaService] Fix notifications stacking with notify-osd



commit 85e1590e297bef7678ffe87c26f286ae165a3353
Author: Chow Loong Jin <hyperair gmail com>
Date:   Sun Oct 4 14:11:13 2009 +0200

    [NotificationAreaService] Fix notifications stacking with notify-osd
    
    Notify-osd ignores CloseNotification calls, so rather than closing the
    notifications when we have a new song, we reuse the old notification.
    Fixes BGO#597099.
    
    Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>

 .../NotificationAreaService.cs                     |   27 +++++++++-----------
 1 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
index d93cc14..f937f99 100644
--- a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
+++ b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
@@ -446,24 +446,21 @@ namespace Banshee.NotificationArea
                 }
             }
             
-            if (current_nf != null) {
-                try {
-                    current_nf.Close ();
-                } catch {}
-                current_nf = null;
-            }
-
             try {
-                Notification nf = new Notification (Catalog.GetString ("Now Playing"), 
-                    message, image, notif_area.Widget);
-                nf.Urgency = Urgency.Low;
-                nf.Timeout = 4500;
+                if (current_nf == null)
+                    current_nf = new Notification (Catalog.GetString ("Now Playing"), 
+                        message, image, notif_area.Widget);
+                else {
+                    current_nf.Body = message;
+                    current_nf.Icon = image;
+                    current_nf.AttachWidget = notif_area.Widget;
+                }
+                current_nf.Urgency = Urgency.Low;
+                current_nf.Timeout = 4500;
                 if (!current_track.IsLive && ActionsSupported && interface_action_service.PlaybackActions["NextAction"].Sensitive) {
-                    nf.AddAction ("skip-song", Catalog.GetString("Skip this item"), OnSongSkipped);
+                    current_nf.AddAction ("skip-song", Catalog.GetString("Skip this item"), OnSongSkipped);
                 }
-                nf.Show ();
-                
-                current_nf = nf;
+                current_nf.Show ();
             } catch (Exception e) {
                 Hyena.Log.Warning (Catalog.GetString ("Cannot show notification"), e.Message, false);
             }



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