[gnome-shell-extensions] window-list: Don't unnecessarily add/remove window buttons



commit 70056ba56e4756b9c09e6d419d1903e0f6f07afd
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri May 23 00:20:08 2014 +0200

    window-list: Don't unnecessarily add/remove window buttons
    
    Since commit 191c7ccc24d, we check whether we already have a window
    in the list before re-adding it on MetaWorkspace::window-added.
    We can do something similar on MetaWorkspace::window-removed to
    avoid some extra work when a window is moved between workspaces
    rather than destroyed.

 extensions/window-list/extension.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 934f9c1..f84248c 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -217,6 +217,9 @@ const WindowButton = new Lang.Class({
         this._switchWorkspaceId =
             global.window_manager.connect('switch-workspace',
                                           Lang.bind(this, this._updateVisibility));
+        this._workspaceChangedId =
+            this.metaWindow.connect('workspace-changed',
+                                    Lang.bind(this, this._updateVisibility));
         this._updateVisibility();
 
         this._notifyFocusId =
@@ -281,6 +284,7 @@ const WindowButton = new Lang.Class({
     },
 
     _onDestroy: function() {
+        this.metaWindow.disconnect(this._workspaceChangedId);
         global.window_manager.disconnect(this._switchWorkspaceId);
         global.display.disconnect(this._notifyFocusId);
         this._contextMenu.destroy();
@@ -1006,6 +1010,9 @@ const WindowList = new Lang.Class({
             return;
         }
 
+        if (win.get_compositor_private())
+            return; // not actually removed, just moved to another workspace
+
         let children = this._windowList.get_children();
         for (let i = 0; i < children.length; i++) {
             if (children[i]._delegate.metaWindow == win) {


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