iconGrid: Don't enter an infinite loop

If both spacing and -shell-grid-item-size are 0, as they would be with nothing
setting them, we enter an infinite loop where we try to compute the layout.
Avoid the situation entirely by defaulting -shell-grid-item-size to a sane
value instead of 0.

https://bugzilla.gnome.org/show_bug.cgi?id=662747
This commit is contained in:
Jasper St. Pierre 2011-11-19 15:27:36 -05:00
parent 4886238761
commit 27b34992c6

View File

@ -305,7 +305,7 @@ const IconGrid = new Lang.Class({
_onStyleChanged: function() {
let themeNode = this.actor.get_theme_node();
this._spacing = themeNode.get_length('spacing');
this._item_size = themeNode.get_length('-shell-grid-item-size');
this._item_size = themeNode.get_length('-shell-grid-item-size') || ICON_SIZE;
this._grid.queue_relayout();
},