diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 6a6a34b99..ffc79a220 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -494,7 +494,6 @@ const Notification = new Lang.Class({ this.resident = false; // 'transient' is a reserved keyword in JS, so we have to use an alternate variable name this.isTransient = false; - this.isMusic = false; this.forFeedback = false; this.expanded = false; this.focused = false; @@ -1426,16 +1425,7 @@ const Source = new Lang.Class({ // Default implementation is to destroy this source, but subclasses can override _lastNotificationRemoved: function() { this.destroy(); - }, - - getMusicNotification: function() { - for (let i = 0; i < this.notifications.length; i++) { - if (this.notifications[i].isMusic) - return this.notifications[i]; - } - - return null; - }, + } }); Signals.addSignalMethods(Source.prototype); diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index cc4a550ed..f73954aa2 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -351,9 +351,6 @@ const FdoNotificationDaemon = new Lang.Class({ })); } - // Mark music notifications so they can be shown in the screen shield - notification.isMusic = (ndata.hints['category'] == 'x-gnome.music'); - let gicon = this._iconForNotificationData(icon, hints); let gimage = this._imageForNotificationData(hints); diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index f2551f6b9..f0e6dddf5 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -103,16 +103,12 @@ const NotificationsBox = new Lang.Class({ name: 'screenShieldNotifications', style_class: 'screen-shield-notifications-box' }); - this._musicBin = new St.Bin({ style_class: 'screen-shield-notifications-box', - visible: false }); - this._scrollView = new St.ScrollView({ x_fill: false, x_align: St.Align.START, hscrollbar_policy: Gtk.PolicyType.NEVER }); this._notificationBox = new St.BoxLayout({ vertical: true, style_class: 'screen-shield-notifications-box' }); this._scrollView.add_actor(this._notificationBox); - this.actor.add(this._musicBin); this.actor.add(this._scrollView, { x_fill: true, x_align: St.Align.START }); this._sources = new Map(); @@ -139,12 +135,11 @@ const NotificationsBox = new Lang.Class({ }, _updateVisibility: function() { - this._musicBin.visible = this._musicBin.child != null && this._musicBin.child.visible; this._notificationBox.visible = this._notificationBox.get_children().some(function(a) { return a.visible; }); - this.actor.visible = this._musicBin.visible || this._notificationBox.visible; + this.actor.visible = this._notificationBox.visible; }, _makeNotificationCountText: function(count, isChat) { @@ -192,7 +187,7 @@ const NotificationsBox = new Lang.Class({ for (let i = 0; i < source.notifications.length; i++) { let n = source.notifications[i]; - if (n.acknowledged || n.isMusic) + if (n.acknowledged) continue; let body = ''; @@ -213,29 +208,13 @@ const NotificationsBox = new Lang.Class({ }, _showSource: function(source, obj, box) { - let musicNotification = source.getMusicNotification(); - - if (musicNotification != null && - this._musicBin.child == null) { - musicNotification.acknowledged = true; - if (musicNotification.actor.get_parent() != null) - musicNotification.actor.get_parent().remove_actor(musicNotification.actor); - this._musicBin.child = musicNotification.actor; - this._musicBin.child.visible = obj.visible; - - musicNotification.expand(false /* animate */); - - obj.musicNotification = musicNotification; - } - if (obj.detailed) { [obj.titleLabel, obj.countLabel] = this._makeNotificationDetailedSource(source, box); } else { [obj.titleLabel, obj.countLabel] = this._makeNotificationSource(source, box); } - box.visible = obj.visible && - (source.unseenCount > (musicNotification ? 1 : 0)); + box.visible = obj.visible && (source.unseenCount > 0); }, _sourceAdded: function(tray, source, initial) { @@ -246,8 +225,6 @@ const NotificationsBox = new Lang.Class({ sourceCountChangedId: 0, sourceTitleChangedId: 0, sourceUpdatedId: 0, - sourceNotifyId: 0, - musicNotification: null, sourceBox: null, titleLabel: null, countLabel: null, @@ -257,12 +234,6 @@ const NotificationsBox = new Lang.Class({ this._showSource(source, obj, obj.sourceBox); this._notificationBox.add(obj.sourceBox, { x_fill: false, x_align: St.Align.START }); - if (obj.musicNotification) { - obj.sourceNotifyId = source.connect('notify', Lang.bind(this, function(source, notification) { - notification.acknowledged = true; - })); - } - obj.sourceCountChangedId = source.connect('count-updated', Lang.bind(this, function(source) { this._countChanged(source, obj); })); @@ -323,8 +294,7 @@ const NotificationsBox = new Lang.Class({ obj.countLabel.text = this._makeNotificationCountText(count, source.isChat); } - obj.sourceBox.visible = obj.visible && - (source.unseenCount > (obj.musicNotification ? 1 : 0)); + obj.sourceBox.visible = obj.visible && (source.unseenCount > 0); this._updateVisibility(); if (obj.sourceBox.visible) @@ -336,10 +306,7 @@ const NotificationsBox = new Lang.Class({ return; obj.visible = source.policy.showInLockScreen; - if (obj.musicNotification) - obj.musicNotification.actor.visible = obj.visible; - obj.sourceBox.visible = obj.visible && - source.unseenCount > (obj.musicNotification ? 1 : 0); + obj.sourceBox.visible = obj.visible && source.unseenCount > 0; this._updateVisibility(); if (obj.sourceBox.visible) @@ -366,13 +333,6 @@ const NotificationsBox = new Lang.Class({ obj.sourceBox.destroy(); obj.sourceBox = obj.titleLabel = obj.countLabel = null; - if (obj.musicNotification) { - this._musicBin.child = null; - obj.musicNotification = null; - - source.disconnect(obj.sourceNotifyId); - } - source.disconnect(obj.sourceDestroyId); source.disconnect(obj.sourceCountChangedId); source.disconnect(obj.sourceTitleChangedId);