From 0861745de4d7b615054d96e40594adf2045fa160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 30 Apr 2013 20:28:01 +0200 Subject: [PATCH] window-list: Use notify::n-workspaces to recreate workspace menu When the number of workspaces changes, we clear the existing menu and recreate it based on the screen::n-workspaces property, so it is slightly more correct to track changes to the property directly instead of using the workspace-added/workspace-removed signals. This change also fixes a corner case, where changes to the property before workspaces are initialized are missed and we end up with the wrong number of workspaces. https://bugzilla.gnome.org/show_bug.cgi?id=699350 --- extensions/window-list/extension.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 93f9456d..1c46791e 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -390,8 +390,7 @@ const WorkspaceIndicator = new Lang.Class({ this.workspacesItems = []; this._screenSignals = []; - this._screenSignals.push(global.screen.connect_after('workspace-added', Lang.bind(this,this._updateMenu))); - this._screenSignals.push(global.screen.connect_after('workspace-removed', Lang.bind(this,this._updateMenu))); + this._screenSignals.push(global.screen.connect('notify::n-workspaces', Lang.bind(this,this._updateMenu))); this._screenSignals.push(global.screen.connect_after('workspace-switched', Lang.bind(this,this._updateIndicator))); this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));