[gnome-shell] [lookingGlass] Don't connect multiple times to the "unmanaged" signal



commit 929bf7f9895c2a360e407d80a3246073d97ed622
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sun May 30 22:48:41 2010 +0200

    [lookingGlass] Don't connect multiple times to the "unmanaged" signal

 js/ui/lookingGlass.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index e75151a..2a175fe 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -223,7 +223,11 @@ WindowList.prototype = {
         let tracker = Shell.WindowTracker.get_default();
         for (let i = 0; i < windows.length; i++) {
             let metaWindow = windows[i].metaWindow;
-            metaWindow.connect('unmanaged', Lang.bind(this, this._updateWindowList));
+            // Avoid multiple connections
+            if (!metaWindow._lookingGlassManaged) {
+                metaWindow.connect('unmanaged', Lang.bind(this, this._updateWindowList));
+                metaWindow._lookingGlassManaged = true;
+            }
             let box = new St.BoxLayout({ vertical: true });
             this.actor.add(box);
             let windowLink = new ObjLink(metaWindow, metaWindow.title);



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