[gnome-shell] Adjust behavior of search results to match app well



commit 97e19d7d4a0ec4f980b9c30ca3ddd4dc5bf1519c
Author: Florian Müllner <fmuellner src gnome org>
Date:   Mon Feb 15 23:11:09 2010 +0100

    Adjust behavior of search results to match app well
    
    Currently, activating a search result always opens a new window. Change
    this behavior, so that if an application has open windows, the most
    recently used one is activated instead.
    
    Also change the implementation of dnd of search results to allow providers
    to treat results activated via dnd differently.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=610027

 js/ui/appDisplay.js |   10 ++++++++++
 js/ui/dash.js       |    5 ++++-
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 6e934c2..1af7994 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -237,6 +237,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 90c8abe..38a8590 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);
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]