From 2d716041f160a9960e18207fbbb6a52dd98e9087 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 9 Feb 2011 17:43:09 -0500 Subject: [PATCH] Make clicking on the active workspace thumbnail go to the main view If you want to select a workspace and go there, having to go back to the main part of the window selector and click on a window is annoying, so make a second click on the active workspace go to the main view. https://bugzilla.gnome.org/show_bug.cgi?id=641973 --- js/ui/workspaceThumbnail.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 7e46a2860..df6ab103b 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -146,7 +146,7 @@ WorkspaceThumbnail.prototype = { })); this.actor.connect('button-release-event', Lang.bind(this, function(actor, event) { - this.metaWorkspace.activate(event.get_time()); + this._activate(); return true; })); @@ -264,7 +264,7 @@ WorkspaceThumbnail.prototype = { let clone = new WindowClone(win); clone.connect('selected', - Lang.bind(this, this._onCloneSelected)); + Lang.bind(this, this._activate)); clone.connect('drag-begin', Lang.bind(this, function(clone) { Main.overview.beginWindowDrag(); @@ -280,8 +280,12 @@ WorkspaceThumbnail.prototype = { return clone; }, - _onCloneSelected : function (clone, time) { - this.metaWorkspace.activate(time); + _activate : function (clone, time) { + // a click on the already current workspace should go back to the main view + if (this.metaWorkspace == global.screen.get_active_workspace()) + Main.overview.hide(); + else + this.metaWorkspace.activate(time); }, // Draggable target interface