[gnome-shell] MessageTray: actually respect other components acking notifications



commit ae6d7bbfa3d21e5cc34bafd8f1ec25512c479af8
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun May 12 19:52:58 2013 +0200

    MessageTray: actually respect other components acking notifications
    
    If a notification is marked acknowledged from outside, filter it
    out from the queue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698812

 js/ui/messageTray.js |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index c1c3a83..5cdaf2d 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -2196,7 +2196,10 @@ const MessageTray = new Lang.Class({
     // at the present time.
     _updateState: function() {
         // Notifications
-        let notificationQueue = this._notificationQueue;
+        let notificationQueue = this._notificationQueue.filter(function(n) {
+            return !n.acknowledged;
+        });
+        this._notificationQueue = notificationQueue;
         let notificationUrgent = notificationQueue.length > 0 && notificationQueue[0].urgency == 
Urgency.CRITICAL;
         let notificationForFeedback = notificationQueue.length > 0 && notificationQueue[0].forFeedback;
         let notificationsLimited = this._busy || Main.layoutManager.bottomMonitor.inFullscreen;
@@ -2637,16 +2640,8 @@ const MessageTray = new Lang.Class({
 
         let hasRightClickMenu = this._summaryBoxPointerItem.rightClickMenu != null;
         if (this._clickedSummaryItemMouseButton == 1 || !hasRightClickMenu) {
-            let newQueue = [];
-            for (let i = 0; i < this._notificationQueue.length; i++) {
-                let notification = this._notificationQueue[i];
-                let sameSource = this._summaryBoxPointerItem.source == notification.source;
-                if (sameSource)
-                    notification.acknowledged = true;
-                else
-                    newQueue.push(notification);
-            }
-            this._notificationQueue = newQueue;
+            // Acknowledge all our notifications
+            this._summmaryBoxPointerItem.source.notifications.forEach(function(n) { n.acknowledged = true; 
});
 
             this._summaryBoxPointer.bin.child = this._summaryBoxPointerItem.notificationStackWidget;
 


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