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
This commit is contained in:
parent
b53d18fe1c
commit
f8b1a84b81
@ -93,8 +93,9 @@ const NotificationsBox = new Lang.Class({
|
|||||||
|
|
||||||
this._items = [];
|
this._items = [];
|
||||||
Main.messageTray.getSummaryItems().forEach(Lang.bind(this, function(item) {
|
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));
|
this._summaryAddedId = Main.messageTray.connect('summary-item-added', Lang.bind(this, this._summaryItemAdded));
|
||||||
},
|
},
|
||||||
@ -118,7 +119,7 @@ const NotificationsBox = new Lang.Class({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let children = this._persistentNotificationBox.get_children()
|
let children = this._persistentNotificationBox.get_children();
|
||||||
this.actor.visible = children.some(function(a) { return a.visible; });
|
this.actor.visible = children.some(function(a) { return a.visible; });
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -157,7 +158,7 @@ const NotificationsBox = new Lang.Class({
|
|||||||
return [box, countLabel];
|
return [box, countLabel];
|
||||||
},
|
},
|
||||||
|
|
||||||
_summaryItemAdded: function(tray, item) {
|
_summaryItemAdded: function(tray, item, dontUpdateVisibility) {
|
||||||
// Ignore transient sources
|
// Ignore transient sources
|
||||||
if (item.source.isTransient)
|
if (item.source.isTransient)
|
||||||
return;
|
return;
|
||||||
@ -186,7 +187,8 @@ const NotificationsBox = new Lang.Class({
|
|||||||
obj.sourceDestroyId = item.source.connect('destroy', Lang.bind(this, this._onSourceDestroy));
|
obj.sourceDestroyId = item.source.connect('destroy', Lang.bind(this, this._onSourceDestroy));
|
||||||
this._items.push(obj);
|
this._items.push(obj);
|
||||||
|
|
||||||
this._updateVisibility();
|
if (!dontUpdateVisibility)
|
||||||
|
this._updateVisibility();
|
||||||
},
|
},
|
||||||
|
|
||||||
_findSource: function(source) {
|
_findSource: function(source) {
|
||||||
|
Loading…
Reference in New Issue
Block a user