[workspaces] Only allow mouse clicks to swich for empty workspaces

Allowing it in the case of 1 window is weird - it makes it feel
like a bug when you go from 1 to 2.
This commit is contained in:
Colin Walters 2010-04-16 16:50:26 -04:00
parent 54168fcd31
commit 4a0fbf03a8

View File

@ -625,10 +625,11 @@ Workspace.prototype = {
this._desktop.connect('selected',
Lang.bind(this,
function(clone, time) {
// Only switch to the workspace when one window is open
// We check for "2" here because the Desktop does not really count
// as a window in this context.
if (this._windows.length <= 2) {
// Only switch to the workspace when there's no application windows
// open (we always have one window for the desktop). The problem
// is that it's too easy to miss an app window and get the wrong
// one focused.
if (this._windows.length == 1) {
this.metaWorkspace.activate(time);
Main.overview.hide();
}