From 2016e08f7b9fde6744c2bb4c18711290c99e4413 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Sun, 7 Mar 2010 19:33:58 +0100 Subject: [PATCH] Don't activate workspace when more than one window is open Currently clicking on an empty spot on the workspace actors switches to the workspace, this has a side effect that when for some reason (like using a touchpad), the user misses the window he intends to open he will end up with the currently focused window instead. Disable this behaviour if more than one window is open (in that case the user has to explicitly target a specific window). https://bugzilla.gnome.org/show_bug.cgi?id=610868 --- js/ui/workspace.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 4c440dec8..4d9bf30c4 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -639,8 +639,13 @@ Workspace.prototype = { this._desktop.connect('selected', Lang.bind(this, function(clone, time) { - this._metaWorkspace.activate(time); - Main.overview.hide(); + // 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) { + this._metaWorkspace.activate(time); + Main.overview.hide(); + } })); this.actor.add_actor(this._desktop.actor);