Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2102)
+++ ChangeLog	(working copy)
@@ -60,6 +60,15 @@
           def saveOldAppSettings():
           def restoreOldAppSettings(prefsDict):
 
+        * src/orca/default.py:
+          src/orca/hierarchical_presenter.py:
+          src/orca_focus_tracking_presenter.py:
+          src/orca/util.py:
+          Another partial fix for bug #395548.
+
+          Moved:
+          def findActiveWindow():
+
 2007-03-04  Willie Walker <william.walker@sun.com>
 
 	* src/orca/Gecko.py, src/orca/default.py, src/orca/flat_review.py:
Index: src/orca/util.py
===================================================================
--- src/orca/util.py	(revision 2102)
+++ src/orca/util.py	(working copy)
@@ -1291,25 +1291,3 @@
     else:
         return orca_state.locusOfFocus \
                and (orca_state.locusOfFocus.app == obj.app)
-
-def findActiveWindow():
-    """Traverses the list of known apps looking for one who has an
-    immediate child (i.e., a window) whose state includes the active state.
-
-    Returns the Python Accessible of the window that's active or None if
-    no windows are active.
-    """
-
-    window = None
-    apps = getKnownApplications()
-    for app in apps:
-        for i in range(0, app.childCount):
-            try:
-                state = app.child(i).state
-                if state.count(atspi.Accessibility.STATE_ACTIVE) > 0:
-                    window = app.child(i)
-                    break
-            except:
-                debug.printException(debug.LEVEL_FINEST)
-
-    return window
Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 2102)
+++ src/orca/default.py	(working copy)
@@ -3416,6 +3416,28 @@
 # here so that they can be customized in application scripts if so desired.
 # 
 
+    def findActiveWindow(self):
+        """Traverses the list of known apps looking for one who has an
+        immediate child (i.e., a window) whose state includes the active state.
+
+        Returns the Python Accessible of the window that's active or None if
+        no windows are active.
+        """
+
+        window = None
+        apps = util.getKnownApplications()
+        for app in apps:
+            for i in range(0, app.childCount):
+                try:
+                    state = app.child(i).state
+                    if state.count(atspi.Accessibility.STATE_ACTIVE) > 0:
+                        window = app.child(i)
+                        break
+                except:
+                    debug.printException(debug.LEVEL_FINEST)
+
+        return window
+
     def saveOldAppSettings(self):
         """Save a copy of all the existing application specific settings
         (as specified by the settings.userCustomizableSettings dictionary)."""
Index: src/orca/focus_tracking_presenter.py
===================================================================
--- src/orca/focus_tracking_presenter.py	(revision 2102)
+++ src/orca/focus_tracking_presenter.py	(working copy)
@@ -865,7 +865,7 @@
         self._registerEventListener("window:deactivate")
         self._registerEventListener("object:children-changed:remove")
 
-        win = util.findActiveWindow()
+        win = orca_state.activeScript.findActiveWindow()
         if win:
             # Generate a fake window activation event so the application
             # can tell the user about itself.
Index: src/orca/hierarchical_presenter.py
===================================================================
--- src/orca/hierarchical_presenter.py	(revision 2101)
+++ src/orca/hierarchical_presenter.py	(working copy)
@@ -438,7 +438,7 @@
 
         apps = util.getKnownApplications()
 
-        win = util.findActiveWindow()
+        win = orca_state.activeScript.findActiveWindow()
 
         if win:
             self._currentObject = win.app
