diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 1af79941b..026ec1102 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -55,7 +55,7 @@ AppDisplayItem.prototype = { let windows = app.get_windows(); if (windows.length > 0) { let mostRecentWindow = windows[0]; - Main.overview.activateWindow(mostRecentWindow, global.get_current_time()); + Main.activateWindow(mostRecentWindow); } else { this._appInfo.launch(); } @@ -240,7 +240,7 @@ BaseAppSearchProvider.prototype = { let windows = app.get_windows(); if (windows.length > 0) - Main.overview.activateWindow(windows[0], global.get_current_time()); + Main.activateWindow(windows[0]); else app.launch(); }, @@ -439,7 +439,7 @@ AppWellIcon.prototype = { activateMostRecentWindow: function () { let mostRecentWindow = this.app.get_windows()[0]; - Main.overview.activateWindow(mostRecentWindow, global.get_current_time()); + Main.activateWindow(mostRecentWindow); }, highlightWindow: function(metaWindow) { @@ -453,7 +453,7 @@ AppWellIcon.prototype = { activateWindow: function(metaWindow) { if (metaWindow) { this._didActivateWindow = true; - Main.overview.activateWindow(metaWindow, global.get_current_time()); + Main.activateWindow(metaWindow); } else Main.overview.hide(); }, diff --git a/js/ui/main.js b/js/ui/main.js index aced13901..a749a0175 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -401,7 +401,8 @@ function getRunDialog() { * @window: the Meta.Window to activate * @time: (optional) current event time * - * Activates @window, switching to its workspace first if necessary + * Activates @window, switching to its workspace first if necessary, + * and switching out of the overview if it's currently active */ function activateWindow(window, time) { let activeWorkspaceNum = global.screen.get_active_workspace_index(); @@ -416,6 +417,8 @@ function activateWindow(window, time) { } else { window.activate(time); } + + overview.hide(); } // TODO - replace this timeout with some system to guess when the user might diff --git a/js/ui/overview.js b/js/ui/overview.js index 488ddd8fa..50edd9cf0 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -564,20 +564,6 @@ Overview.prototype = { return this._workspaces; }, - /** - * activateWindow: - * @metaWindow: A #MetaWindow - * @time: Event timestamp integer - * - * Make the given MetaWindow be the focus window, switching - * to the workspace it's on if necessary. This function - * should only be used when the Overview is currently active; - * outside of that, use the relevant methods on MetaDisplay. - */ - activateWindow: function (metaWindow, time) { - this._workspaces.activateWindowFromOverview(metaWindow, time); - }, - //// Private methods //// _showDone: function() { diff --git a/js/ui/workspace.js b/js/ui/workspace.js index f7668d458..c91ea12a4 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -1419,7 +1419,7 @@ Workspace.prototype = { }, _onCloneSelected : function (clone, time) { - Main.overview.activateWindow(clone.metaWindow, time); + Main.activateWindow(clone.metaWindow, time); }, _removeSelf : function(actor, event) { diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index dc6aa7d57..c78d1d4c6 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -163,27 +163,13 @@ GenericWorkspacesView.prototype = { } }, - /** - * activateWindowFromOverview: - * @metaWindow: A #MetaWindow - * @time: Integer even timestamp - * - * This function exits the overview, switching to the given @metaWindow. - * If an application filter is in effect, it will be cleared. - */ - activateWindowFromOverview: function (metaWindow, time) { - if (this._windowSelectionAppId != null) { - this._clearApplicationWindowSelection(false); - } - - Main.activateWindow(metaWindow, time); - Main.overview.hide(); - }, - hide: function() { let activeWorkspaceIndex = global.screen.get_active_workspace_index(); let activeWorkspace = this._workspaces[activeWorkspaceIndex]; + if (this._windowSelectionAppId != null) + this._clearApplicationWindowSelection(false); + activeWorkspace.actor.raise_top(); for (let w = 0; w < this._workspaces.length; w++)