=== modified file 'modules/overlay/overlay.module'
--- modules/overlay/overlay.module	2010-04-21 07:23:10 +0000
+++ modules/overlay/overlay.module	2010-04-23 04:08:05 +0000
@@ -209,35 +209,13 @@ function overlay_batch_alter(&$batch) {
 }
 
 /**
- * Implements hook_page_alter().
+ * Implements hook_region_list_alter().
  */
-function overlay_page_alter(&$page) {
+function overlay_region_list_alter(&$list, $theme_key, $show) {
   // If we are limiting rendering to a subset of page regions, deny access to
   // all other regions so that they will not be processed.
   if ($regions_to_render = overlay_get_regions_to_render()) {
-    $skipped_regions = array_diff(element_children($page), $regions_to_render);
-    foreach ($skipped_regions as $skipped_region) {
-      $page[$skipped_region]['#access'] = FALSE;
-    }
-  }
-}
-
-/**
- * Implements hook_block_info_alter().
- */
-function overlay_block_info_alter(&$blocks) {
-  // If we are limiting rendering to a subset of page regions, hide all blocks
-  // which appear in regions not on that list. Note that overlay_page_alter()
-  // does a more comprehensive job of preventing unwanted regions from being
-  // displayed (regardless of whether they contain blocks or not), but the
-  // reason for duplicating effort here is performance; we do not even want
-  // these blocks to be built if they are not going to be displayed.
-  if ($regions_to_render = overlay_get_regions_to_render()) {
-    foreach ($blocks as $bid => $block) {
-      if (!in_array($block->region, $regions_to_render)) {
-        unset($blocks[$bid]);
-      }
-    }
+    $list[$theme_key][$show] = array_diff_key($list[$theme_key][$show], array_flip($regions_to_render));
   }
 }
 

=== modified file 'modules/system/system.api.php'
--- modules/system/system.api.php	2010-04-20 18:48:05 +0000
+++ modules/system/system.api.php	2010-04-23 04:00:28 +0000
@@ -3308,5 +3308,23 @@ function hook_filetransfer_backends() {
 }
 
 /**
+ * @param &$list 
+ *   List of the available regions from a specified theme.
+ * @param $theme_key
+ *   The name of the theme.
+ * @param $show
+ *   Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes hidden
+ *   regions.
+ */
+function hook_region_list_alter(&$list, $theme_key, $show) {
+  // The 'sidebar_visible' field instance on 'page' node types controls the
+  // 'sidebar' region.
+  if (($node = menu_get_object()) && $node->type == 'page' && !$node->sidebar_visible[LANGUAGE_NONE][0]['value']) {
+    unset($list[$theme_key][$show]['sidebar']);
+  }
+}
+
+
+/**
  * @} End of "addtogroup hooks".
  */

=== modified file 'modules/system/system.module'
--- modules/system/system.module	2010-04-13 15:23:02 +0000
+++ modules/system/system.module	2010-04-23 03:59:40 +0000
@@ -2512,6 +2512,7 @@ function system_region_list($theme_key, 
         $list[$theme_key][$show][$name] = $label;
       }
     }
+    drupal_alter('system_region_list', $list, $theme_key, $show);
   }
   return $list[$theme_key][$show];
 }

