[gnome-shell] messageTray: Remove code that happens on notification destruction



commit c4bc9616af9df96bafe454e6f52bfc281bca4c95
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Aug 2 00:09:33 2013 -0400

    messageTray: Remove code that happens on notification destruction

 js/ui/messageTray.js |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 5ae0771..4fae789 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1950,26 +1950,11 @@ const MessageTray = new Lang.Class({
         source.disconnect(obj.destroyId);
         source.disconnect(obj.mutedChangedId);
 
-        let needUpdate = false;
-
-        if (this._notification && this._notification.source == source) {
-            this._updateNotificationTimeout(0);
-            this._notificationRemoved = true;
-            needUpdate = true;
-        }
-        if (this._clickedSummaryItem == summaryItem) {
-            this._setClickedSummaryItem(null);
-            needUpdate = true;
-        }
-
         summaryItem.destroy();
 
         this.emit('source-removed', source);
 
         this._updateNoMessagesLabel();
-
-        if (needUpdate)
-            this._updateState();
     },
 
     getSources: function() {
@@ -2689,6 +2674,10 @@ const MessageTray = new Lang.Class({
 
         if (this._clickedSummaryItem) {
             this._clickedSummaryItem.actor.add_style_pseudo_class('selected');
+            this._clickedSummaryItem.actor.connect('destroy', Lang.bind(this, function() {
+                this._setClickedSummaryItem(null);
+                this._updateState();
+            }));
             this._clickedSummaryItemAllocationChangedId =
                 this._clickedSummaryItem.actor.connect('allocation-changed',
                                                        Lang.bind(this, 
this._adjustSummaryBoxPointerPosition));


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