iconGrid: Make sure the style is updated before computing the layout
In some cases the style-changed signal hasn't been emitted when _computeLayout() is called, resulting in the use of the default spacing and item size values for the calculations. One case where this happens is when starting a search. Right after the initialization of GridSearchResults, _computeLayout() is called from _getMaxDisplayedResults() and the style-changed signal hasn't been emitted yet. The computed layout will be wrong and the maximum number of results will also be wrong. To prevent this from happening, make sure the style has been updated before doing the calculations in _computeLayout(). https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110
This commit is contained in:
parent
1a27ff6130
commit
8f0e9abe47
@ -602,6 +602,8 @@ var IconGrid = GObject.registerClass({
|
||||
}
|
||||
|
||||
_computeLayout(forWidth) {
|
||||
this.ensure_style();
|
||||
|
||||
let nColumns = 0;
|
||||
let usedWidth = this.leftPadding + this.rightPadding;
|
||||
let spacing = this._getSpacing();
|
||||
|
Loading…
Reference in New Issue
Block a user