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
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user