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
This commit is contained in:
parent
94f32030e6
commit
97e19d7d4a
@ -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();
|
||||
}
|
||||
|
@ -390,6 +390,9 @@ SearchResult.prototype = {
|
||||
},
|
||||
|
||||
shellWorkspaceLaunch: function() {
|
||||
if (this.provider.dragActivateResult)
|
||||
this.provider.dragActivateResult(this.metaInfo.id);
|
||||
else
|
||||
this.provider.activateResult(this.metaInfo.id);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user