Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 3090)
+++ src/orca/default.py	(working copy)
@@ -5756,11 +5756,11 @@
         window = None
         apps = self.getKnownApplications()
         for app in apps:
-            for i in range(0, app.childCount):
+            for child in app:
                 try:
-                    state = app.child(i).state
-                    if state.count(atspi.Accessibility.STATE_ACTIVE) > 0:
-                        window = app.child(i)
+                    state = child.getState()
+                    if state.contains(pyatspi.STATE_ACTIVE) > 0:
+                        window = child
                         break
                 except:
                     debug.printException(debug.LEVEL_FINEST)
