summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-10-06 18:07:40 (GMT)
committerColin Walters <walters@verbum.org>2009-10-06 19:12:20 (GMT)
commitd120d03de9b758366c3ae3e040b765f26a12f6e8 (patch)
treeebea8b4b070eacadc960c190b557cb8ed48d20bd
parent53fbabe2ca5a10f5ecc727cf390630858e359e5c (diff)
downloadgnome-shell-d120d03de9b758366c3ae3e040b765f26a12f6e8.tar.gz
gnome-shell-d120d03de9b758366c3ae3e040b765f26a12f6e8.tar.xz
Workaround being allocated 0x0
Because of a chain of bugs we could end up getting allocated 0x0, and this would cause the WellGrid allocation code to be unhappy. See http://bugzilla.openedhand.com/show_bug.cgi?id=1831 Simply treat 0 as "unlimited" i.e. equivalent to -1. https://bugzilla.gnome.org/show_bug.cgi?id=597586
-rw-r--r--js/ui/appDisplay.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 3e9a3bd..85b6ee6 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -695,7 +695,10 @@ WellGrid.prototype = {
return [0, WELL_DEFAULT_COLUMNS, 0, 0];
let nColumns = 0;
let usedWidth = 0;
- if (forWidth < 0) {
+ // Big.Box will allocate us at 0x0 if we are not visible; this is probably a
+ // Big.Box bug but it can't be fixed because if children are skipped in allocate()
+ // Clutter gets confused (see http://bugzilla.openedhand.com/show_bug.cgi?id=1831)
+ if (forWidth <= 0) {
nColumns = WELL_DEFAULT_COLUMNS;
} else {
while (nColumns < WELL_DEFAULT_COLUMNS &&
@@ -720,7 +723,7 @@ WellGrid.prototype = {
let rows = Math.ceil(children.length / nColumns);
let itemWidth;
- if (forWidth < 0) {
+ if (forWidth <= 0) {
itemWidth = itemNaturalWidth;
} else {
itemWidth = Math.floor(forWidth / nColumns);