[gnome-shell] [AppDisplay] In search/browse, show existing window instead of always launching



commit dddad9e1b5c021b6803bf8a17500aeb8789e1076
Author: Colin Walters <walters verbum org>
Date:   Wed Sep 9 16:43:29 2009 -0400

    [AppDisplay] In search/browse, show existing window instead of always launching
    
    This brings search in line with the AppWell behavior which is definitely
    right.  For browse we probably want more options.

 js/ui/appDisplay.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index cc93fd1..c12f575 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -78,7 +78,13 @@ AppDisplayItem.prototype = {
 
     // Opens an application represented by this display item.
     launch : function() {
-        this._appInfo.launch();
+        let windows = Shell.AppMonitor.get_default().get_windows_for_app(this._appInfo.get_id());
+        if (windows.length > 0) {
+            let mostRecentWindow = windows[0];
+            Main.overview.activateWindow(mostRecentWindow, Clutter.get_current_event_time());
+        } else {
+            this._appInfo.launch();
+        }
     },
 
     //// Protected method overrides ////



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