[gnome-shell] ScreenShield: Fix updating visibility of the notification box



commit f8b1a84b81328f1594b468a65a16c3b2fdf6cb54
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu Aug 16 22:38:22 2012 +0200

    ScreenShield: Fix updating visibility of the notification box
    
    If there were no persistent or resident notification sources,
    nothing ever would call _updateVisibility, and the box would stay
    there empty
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681143

 js/ui/screenShield.js |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 31355a6..5e294c2 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -93,8 +93,9 @@ const NotificationsBox = new Lang.Class({
 
         this._items = [];
         Main.messageTray.getSummaryItems().forEach(Lang.bind(this, function(item) {
-            this._summaryItemAdded(Main.messageTray, item);
+            this._summaryItemAdded(Main.messageTray, item, true);
         }));
+        this._updateVisibility();
 
         this._summaryAddedId = Main.messageTray.connect('summary-item-added', Lang.bind(this, this._summaryItemAdded));
     },
@@ -118,7 +119,7 @@ const NotificationsBox = new Lang.Class({
             return;
         }
 
-        let children = this._persistentNotificationBox.get_children()
+        let children = this._persistentNotificationBox.get_children();
         this.actor.visible = children.some(function(a) { return a.visible; });
     },
 
@@ -157,7 +158,7 @@ const NotificationsBox = new Lang.Class({
         return [box, countLabel];
     },
 
-    _summaryItemAdded: function(tray, item) {
+    _summaryItemAdded: function(tray, item, dontUpdateVisibility) {
         // Ignore transient sources
         if (item.source.isTransient)
             return;
@@ -186,7 +187,8 @@ const NotificationsBox = new Lang.Class({
         obj.sourceDestroyId = item.source.connect('destroy', Lang.bind(this, this._onSourceDestroy));
         this._items.push(obj);
 
-        this._updateVisibility();
+        if (!dontUpdateVisibility)
+            this._updateVisibility();
     },
 
     _findSource: function(source) {



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