Fix workspaces accumulating on each restart.

Main._nWorkspacesChanged was racing with Main._checkWorkspaces.
If _checkWorkspaces won the race, _workspaces was uninitialized.
Because of this, _checkWorkspaces only noticed workspaces
with windows on them, leading it to believe the last workspace wasn't
empty, and added a new, empty workspace.

https://bugzilla.gnome.org/show_bug.cgi?id=645343
This commit is contained in:
Jasper St. Pierre 2011-03-19 19:36:17 -04:00 committed by Owen W. Taylor
parent d38f41a459
commit b16de0e374

View File

@ -223,7 +223,7 @@ function start() {
global.screen.connect('window-entered-monitor', _windowEnteredMonitor); global.screen.connect('window-entered-monitor', _windowEnteredMonitor);
global.screen.connect('window-left-monitor', _windowLeftMonitor); global.screen.connect('window-left-monitor', _windowLeftMonitor);
Mainloop.idle_add(_nWorkspacesChanged); _nWorkspacesChanged();
} }
let _workspaces = []; let _workspaces = [];