[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.
This commit is contained in:
Colin Walters 2009-09-09 16:43:29 -04:00
parent 4bfa68d209
commit dddad9e1b5

View File

@ -78,7 +78,13 @@ AppDisplayItem.prototype = {
// Opens an application represented by this display item. // Opens an application represented by this display item.
launch : function() { 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 //// //// Protected method overrides ////