[gnome-shell] message-tray: Don't update message count after destruction



commit 5f6ac33d5969f19deb311daaecae034ecee70e64
Author: Florian MÃllner <fmuellner gnome org>
Date:   Wed Jul 13 01:18:58 2011 +0200

    message-tray: Don't update message count after destruction
    
    When trying to update the message count after a summary icon has
    been destroyed, the label to display the count is no longer valid
    and trying to set its text results in some Clutter warnings.

 js/ui/messageTray.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index bd55a31..bf72a0f 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -885,6 +885,11 @@ Source.prototype = {
         this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
         this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
         this.actor.connect('allocate', Lang.bind(this, this._allocate));
+        this.actor.connect('destroy', Lang.bind(this,
+            function() {
+                this._actorDestroyed = true;
+            }));
+        this._actorDestroyed = false;
 
         this._counterLabel = new St.Label();
         this._counterBin = new St.Bin({ style_class: 'summary-source-counter',
@@ -949,6 +954,9 @@ Source.prototype = {
     },
 
     _updateCount: function() {
+        if (this._actorDestroyed)
+            return;
+
         let count = this.notifications.length;
         this._setCount(count, count > 1);
     },



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