Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,18 @@ class CinnamonNotificationsApplet extends Applet.TextIconApplet {

_openMenu() {
this._update_timestamp();

this.notifications.forEach(notification => {
global.reparentActor(notification.actor, this._notificationbin);
});

this.menu.toggle();
}

_onMenuClosed() {
this._notificationbin.remove_all_children();
}

_display() {
// Always start the applet empty, void of any notifications.
this.set_applet_icon_symbolic_name("empty-notif");
Expand Down Expand Up @@ -138,8 +147,6 @@ class CinnamonNotificationsApplet extends Applet.TextIconApplet {
if (notification._destroyed) {
this.notifications.splice(existing_index, 1);
} else {
notification._inNotificationBin = true;
global.reparentActor(notification.actor, this._notificationbin);
notification._timeLabel.show();
}
this.update_list();
Expand All @@ -148,11 +155,8 @@ class CinnamonNotificationsApplet extends Applet.TextIconApplet {
return;
}
// Add notification to list.
notification._inNotificationBin = true;
this.notifications.push(notification);
// Steal the notification panel.
this._notificationbin.add(notification.actor);
notification.actor._parent_container = this._notificationbin;

notification.actor.add_style_class_name('notification-applet-padding');
// Register for destruction.
notification.connect('scrolling-changed', (notif, scrolling) => { this.menu.passEvents = scrolling });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"uuid": "notifications@cinnamon.org",
"name": "Notifications",
"description": "Click to display and manage system notifications",
"icon": "cs-notifications"
"icon": "cs-notifications",
"max-instances": -1
}
7 changes: 2 additions & 5 deletions js/ui/messageTray.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,10 @@ var Notification = class Notification {
this._actionArea = null;
this._imageBin = null;
this._timestamp = new Date();
this._inNotificationBin = false;

source.connect('destroy', (source, reason) => { this.destroy(reason) });

this.actor = new St.Button({ accessible_role: Atk.Role.NOTIFICATION });
this.actor._parent_container = null;
this.actor.connect('clicked', () => this._onClicked());
this.actor.connect('destroy', () => this._onDestroy());

Expand Down Expand Up @@ -348,7 +346,6 @@ var Notification = class Notification {
*/
update(title, body, params) {
this._timestamp = new Date();
this._inNotificationBin = false;
params = Params.parse(params, {
icon: null,
titleMarkup: false,
Expand Down Expand Up @@ -929,8 +926,8 @@ MessageTray.prototype = {

_showNotification: function () {
this._notification = this._notificationQueue.shift();
if (this._notification.actor._parent_container) {
this._notification.actor._parent_container.remove_actor(this._notification.actor);
if (this._notification.actor.get_parent()) {
this._notification.actor.get_parent().remove_actor(this._notification.actor);
}

this._notificationBin.child = this._notification.actor;
Expand Down
Loading