messageTray: Remove max notifications limit

parent b8cfe6e4
......@@ -19,8 +19,6 @@ var NOTIFICATION_TIMEOUT = 4000;
var HIDE_TIMEOUT = 200;
var LONGER_HIDE_TIMEOUT = 600;
var MAX_NOTIFICATIONS_IN_QUEUE = 3;
var MAX_NOTIFICATIONS_PER_SOURCE = 3;
var MAX_NOTIFICATION_BUTTONS = 3;
// We delay hiding of the tray if the mouse is within MOUSE_LEFT_ACTOR_THRESHOLD
......@@ -526,6 +524,7 @@ var NotificationBanner = GObject.registerClass({
_init(notification) {
super._init(notification);
this._footerButton.visible = false;
this.can_focus = false;
this.add_style_class_name('notification-banner');
......@@ -798,9 +797,6 @@ var Source = GObject.registerClass({
if (this.notifications.includes(notification))
return;
while (this.notifications.length >= MAX_NOTIFICATIONS_PER_SOURCE)
this.notifications.shift().destroy(NotificationDestroyedReason.EXPIRED);
notification.connect('destroy', this._onNotificationDestroy.bind(this));
notification.connect('notify::acknowledged', this.countUpdated.bind(this));
this.notifications.push(notification);
......@@ -1107,7 +1103,7 @@ var MessageTray = GObject.registerClass({
}
_onNotificationShow(_source, notification) {
if (this._notification == notification) {
if (this._notification === notification) {
// If a notification that is being shown is updated, we update
// how it is shown and extend the time until it auto-hides.
// If a new notification is updated while it is being hidden,
......@@ -1117,16 +1113,10 @@ var MessageTray = GObject.registerClass({
// If the queue is "full", we skip banner mode and just show a small
// indicator in the panel; however do make an exception for CRITICAL
// notifications, as only banner mode allows expansion.
let bannerCount = this._notification ? 1 : 0;
let full = this.queueCount + bannerCount >= MAX_NOTIFICATIONS_IN_QUEUE;
if (!full || notification.urgency == Urgency.CRITICAL) {
notification.connect('destroy',
this._onNotificationDestroy.bind(this));
this._notificationQueue.push(notification);
this._notificationQueue.sort(
(n1, n2) => n2.urgency - n1.urgency);
this.emit('queue-changed');
}
notification.connect('destroy', this._onNotificationDestroy.bind(this));
this._notificationQueue.push(notification);
this._notificationQueue.sort((n1, n2) => n2.urgency - n1.urgency);
this.emit('queue-changed');
}
this._updateState();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment