diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 6e934c2df..1af79941b 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -236,6 +236,16 @@ BaseAppSearchProvider.prototype = { }, activateResult: function(id) { + let app = this._appSys.get_app(id); + let windows = app.get_windows(); + + if (windows.length > 0) + Main.overview.activateWindow(windows[0], global.get_current_time()); + else + app.launch(); + }, + + dragActivateResult: function(id) { let app = this._appSys.get_app(id); app.launch(); } diff --git a/js/ui/dash.js b/js/ui/dash.js index 90c8abe01..38a8590c6 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -390,7 +390,10 @@ SearchResult.prototype = { }, shellWorkspaceLaunch: function() { - this.provider.activateResult(this.metaInfo.id); + if (this.provider.dragActivateResult) + this.provider.dragActivateResult(this.metaInfo.id); + else + this.provider.activateResult(this.metaInfo.id); } }