[gnome-shell] IconGrid: don't ask for the children list when the number is enough
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] IconGrid: don't ask for the children list when the number is enough
- Date: Tue, 6 Aug 2013 14:10:03 +0000 (UTC)
commit c1518dc7289560350b8093f22e03189eb4ffdb5a
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Wed Feb 20 17:02:34 2013 +0100
IconGrid: don't ask for the children list when the number is enough
Clutter keeps the number of children cached, while the list must be
built every time.
js/ui/iconGrid.js | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index e26b6f1..416e659 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -204,10 +204,10 @@ const IconGrid = new Lang.Class({
// later we'll allocate as many children as fit the parent
return;
- let children = this._grid.get_children();
+ let nChildren = this._grid.get_n_children();
let nColumns = this._colLimit ? Math.min(this._colLimit,
- children.length)
- : children.length;
+ nChildren)
+ : nChildren;
let totalSpacing = Math.max(0, nColumns - 1) * this._spacing;
// Kind of a lie, but not really an issue right now. If
// we wanted to support some sort of hidden/overflow that would
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]