search: Drop SearchResultInterface again
It adds a significant cost to AppIcons which are used
- quite a log (depending on installed apps)
- in preformance-sensitive contexts (spring animation)
Just rely on duck typing and revert 91a5133116
.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1799
This commit is contained in:
parent
6f7e5976e2
commit
b1d22d2058
@ -2045,7 +2045,6 @@ var AppFolderPopup = GObject.registerClass({
|
|||||||
|
|
||||||
var AppIcon = GObject.registerClass({
|
var AppIcon = GObject.registerClass({
|
||||||
GTypeName: 'AppDisplay_AppIcon',
|
GTypeName: 'AppDisplay_AppIcon',
|
||||||
Implements: [Search.SearchResultInterface],
|
|
||||||
Signals: {
|
Signals: {
|
||||||
'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
|
'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
|
||||||
'sync-tooltip': {},
|
'sync-tooltip': {},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported SearchResultsView, SearchResultInterface */
|
/* exported SearchResultsView */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
||||||
|
|
||||||
@ -32,17 +32,8 @@ class MaxWidthBox extends St.BoxLayout {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var SearchResultInterface = GObject.registerClass({
|
var SearchResult = GObject.registerClass(
|
||||||
Requires: [Clutter.Actor],
|
class SearchResult extends St.Button {
|
||||||
}, class SearchResultInterface extends GObject.Interface {
|
|
||||||
activate() {
|
|
||||||
throw new GObject.NotImplementedError('activate in %s'.format(this.constructor.name));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var SearchResult = GObject.registerClass({
|
|
||||||
Implements: [SearchResultInterface]
|
|
||||||
}, class SearchResult extends St.Button {
|
|
||||||
_init(provider, metaInfo, resultsView) {
|
_init(provider, metaInfo, resultsView) {
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
this.metaInfo = metaInfo;
|
this.metaInfo = metaInfo;
|
||||||
@ -253,8 +244,6 @@ var SearchResultsBase = GObject.registerClass({
|
|||||||
metasNeeded.forEach((resultId, i) => {
|
metasNeeded.forEach((resultId, i) => {
|
||||||
let meta = metas[i];
|
let meta = metas[i];
|
||||||
let display = this._createResultDisplay(meta);
|
let display = this._createResultDisplay(meta);
|
||||||
if (!(display instanceof SearchResultInterface))
|
|
||||||
throw new Error(`${display} is not a valid search result`);
|
|
||||||
display.connect('key-focus-in', this._keyFocusIn.bind(this));
|
display.connect('key-focus-in', this._keyFocusIn.bind(this));
|
||||||
this._resultDisplays[resultId] = display;
|
this._resultDisplays[resultId] = display;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user