--- homebox.module.orig	2012-03-13 16:54:48.000000000 +0100
+++ homebox.module	2012-03-13 17:02:09.000000000 +0100
@@ -355,8 +355,17 @@
   }
 
   // Sort each region/column based on key value
+  // Also separate the regions into rows based on the region widths
+  $sum_width = 0;
+  $row = 0;
   for ($i = 1; $i <= count($regions); $i++) {
     ksort($regions[$i]);
+    $sum_width += $page->settings['widths'][$i];
+    if ($sum_width > 100) {
+      $row++;
+      $sum_width = 0;
+    }
+    $page->settings['rows'][$i] = $row;
   }
 
   // Add block links
