From 4a0fbf03a8710ae02e687e4de1a4125e8bce7471 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 16 Apr 2010 16:50:26 -0400 Subject: [PATCH] [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. --- js/ui/workspace.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 77d41b45a..d3165c505 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -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(); }