[gnome-shell/wip/fmuellner/notification-redux+sass: 156/207] calendar: Acknowledge seen notifications



commit 34a2d74ca2ac64b82e7747239acffa9d1008e4ba
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Feb 14 03:48:34 2015 +0100

    calendar: Acknowledge seen notifications

 js/ui/calendar.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index b0adf74..c5faa30 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1249,6 +1249,8 @@ const NotificationSection = new Lang.Class({
 
         global.screen.connect('in-fullscreen-changed', Lang.bind(this, this._checkQueue));
 
+        this.actor.connect('notify::mapped', Lang.bind(this, this._onMapped));
+
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
         this._sessionUpdated();
     },
@@ -1291,6 +1293,7 @@ const NotificationSection = new Lang.Class({
             this.removeMessage(listEntry, this.actor.mapped);
         }));
         listEntry.connect('close', function() { notification.destroy(); });
+        listEntry.notification = notification;
         let listChild = this.addMessage(listEntry, this.actor.mapped);
         // TODO: Keep URGENT notifications on top
         this._list.set_child_below_sibling(listChild, null);
@@ -1303,6 +1306,14 @@ const NotificationSection = new Lang.Class({
         this._sources.delete(source);
     },
 
+    _onMapped: function() {
+        if (!this.actor.mapped)
+            return;
+        this._messages.forEach(function(m) {
+            m.notification.acknowledged = true;
+        });
+    },
+
     addNotification: function(notification) {
         let listEntry = new NotificationListEntry(notification);
         // TODO: Keep URGENT notifications on top


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