 //        var target:InteractiveObject = InteractiveObject(event.target);
         // trace("FM " + this + " activateHandler ", _lastFocus);
 		
-		// restore focus if this focus manager had last focus
-	    if (_lastFocus && !browserMode)
-	    	_lastFocus.setFocus();
-	    lastAction = "ACTIVATE";
-    }
-
-    /**
-     *  @private  Useful for debugging
+        // if we were the active FM when we were deactivated
+        // and we're not running in AIR, then dispatch the event now
+        // otherwise wait for the AIR events to fire
+        if (activated && !desktopMode)
+        {
+            dispatchEvent(new FlexEvent(FlexEvent.FLEX_WINDOW_ACTIVATE));
+		    // restore focus if this focus manager had last focus
+	        if (_lastFocus && !browserMode)
+	    	    _lastFocus.setFocus();
+	        lastAction = "ACTIVATE";
+        }
+    }
+
+    /**
+     *  @private  
+     *  Dispatch event if we're not running in AIR.  AIR will
+     *  dispatch windowDeactivate that we respond to instead
      */
     private function deactivateHandler(event:Event):void
     {
         // var target:InteractiveObject = InteractiveObject(event.target);
         // trace("FM " + this + " deactivateHandler ", _lastFocus);
-    }
+
+        // if we are the active FM when we were deactivated
+        // and we're not running in AIR, then dispatch the event now
+        // otherwise wait for the AIR events to fire
+        if (activated && !desktopMode)
+        {
+            dispatchEvent(new FlexEvent(FlexEvent.FLEX_WINDOW_DEACTIVATE));
+        }
+    }
+
+    /**
+     *  @private
+     *  restore focus to whoever had it last
+     */
+    private function activateWindowHandler(event:Event):void
+    {
+//        var target:InteractiveObject = InteractiveObject(event.target);
+        // trace("FM " + this + " activateWindowHandler ", _lastFocus);
+		
+        windowActivated = true;
+
+        if (activated)
+        {
+            dispatchEvent(new FlexEvent(FlexEvent.FLEX_WINDOW_ACTIVATE));
+		    // restore focus if this focus manager had last focus
+	        if (_lastFocus && !browserMode)
+	    	    _lastFocus.setFocus();
+	        lastAction = "ACTIVATE";
+        }
+    }
+
+    /**
+     *  @private  
+     *  If we're responsible for the focused control, remove focus from it
+     *  so it gets the same events as it would if the whole app lost focus
+     */
+    private function deactivateWindowHandler(event:Event):void
+    {
+        // var target:InteractiveObject = InteractiveObject(event.target);
+        // trace("FM " + this + " deactivateWindowHandler ", _lastFocus);
+
+        windowActivated = false;
+
+        if (activated)
+        {
+            dispatchEvent(new FlexEvent(FlexEvent.FLEX_WINDOW_DEACTIVATE));
+            if (form.systemManager.stage)
+                form.systemManager.stage.focus = null;
+        }
+    }   
 
     /**
      *  @inheritDoc

		this.popup = popup;
		
        browserMode = Capabilities.playerType == "ActiveX" && !popup;

        container.focusManager = this; // this property name is reserved in the parent

        // trace("FocusManager constructor " + container + ".focusManager");

    public function set showFocusIndicator(value:Boolean):void
    {
        var changed:Boolean = _showFocusIndicator != value;
        // trace("FM " + this + " showFocusIndicator = " + value);
        _showFocusIndicator = value;

        if (hasEventListener("showFocusIndicator"))
