         
         var request:ModalWindowRequest = ModalWindowRequest.marshal(event);
             
+        if (!preProcessModalWindowRequest(request, this, getSandboxRoot()))
+            return;
+                        
         // Ensure a PopUpManager exists and dispatch the request it is
         // listening for.
         Singleton.getInstance("mx.managers::IPopUpManager");
         dispatchEvent(request);
+    }
+
+    /**
+     *  @private
+     * 
+     *  Calculate the visible rectangle of the requesting application in this
+     *  application. Forward the request to our parent to see this the rectangle
+     *  is further reduced. Continue up the parent chain until the top level
+     *  root parent is reached.
+     */  
+    private function getVisibleRectRequestHandler(event:Event):void
+    {
+        if (event is SandboxBridgeRequest)
+            return;
+        
+        var request:SandboxBridgeRequest = SandboxBridgeRequest.marshal(event);
+        var rect:Rectangle = Rectangle(request.data);
+        var owner:DisplayObject = sandboxBridgeGroup.getChildBridgeOwner(request.requestor);
+        var localRect:Rectangle;
+        
+        if (owner is IApplicationLoader)
+            localRect = IApplicationLoader(owner).getVisibleApplicationRect();
+        else
+        {
+            localRect = owner.getBounds(this);
+            var pt:Point = localToGlobal(localRect.topLeft);
+            localRect.x = pt.x;
+            localRect.y = pt.y;
+        }        
+           
+        rect = rect.intersection(localRect); // update rect
+        request.data = rect;
+        
+        // forward request 
+        if (useBridge())
+        { 
+        var bridge:IEventDispatcher = sandboxBridgeGroup.parentBridge;
+            request.requestor = bridge;
+            bridge.dispatchEvent(request);
+        }
+        
+        Object(event).data = request.data;           // update request
     }
 
 	//--------------------------------------------------------------------------


import mx.core.EmbeddedFontRegistry;
import mx.core.FlexSprite;
import mx.core.IChildList;
import mx.core.IFlexDisplayObject;
import mx.core.IFlexModuleFactory;

        bridge.addEventListener(ModalWindowRequest.CREATE, modalWindowRequestHandler);
        bridge.addEventListener(ModalWindowRequest.SHOW, modalWindowRequestHandler);
        bridge.addEventListener(ModalWindowRequest.HIDE, modalWindowRequestHandler);
        bridge.addEventListener(SandboxBridgeRequest.GET_VISIBLE_RECT, getVisibleRectRequestHandler);
	}

	/**
