OSDN Git Service

IAccessibleHandler.accFocus: Don't call accChild for CHILDID_SELF.
authorJames Teh <jamie@jantrid.net>
Fri, 5 Apr 2013 05:40:53 +0000 (15:40 +1000)
committerJames Teh <jamie@jantrid.net>
Fri, 5 Apr 2013 05:40:53 +0000 (15:40 +1000)
Some implementations do return CHILDID_SELF and we end up in an endless loop when this happens because the objeccts appear different each time, even though we're actually getting different pointers to the same accessible.
This fix means that NVDA no longer freezes when using Asian character input in some .NET applications.
Fixes #3005.

source/IAccessibleHandler.py
user_docs/en/changes.t2t

index c20c706..19209eb 100644 (file)
@@ -369,7 +369,12 @@ def accFocus(ia):
                if isinstance(res,comtypes.client.lazybind.Dispatch) or isinstance(res,comtypes.client.dynamic._Dispatch) or isinstance(res,IUnknown):\r
                        new_ia=normalizeIAccessible(res)\r
                        new_child=0\r
+               elif res==0:\r
+                       # #3005: Don't call accChild for CHILDID_SELF.\r
+                       new_ia=ia\r
+                       new_child=res\r
                elif isinstance(res,int):\r
+                       # accFocus can return a child ID even when there is actually an IAccessible for that child; e.g. Lotus Symphony.\r
                        try:\r
                                new_ia=ia.accChild(res)\r
                        except:\r
index a3bb8d3..ec63430 100644 (file)
@@ -80,6 +80,7 @@ Please see the [Commands Quick Reference keyCommands.html] document for the new
 - Support the form landmark in browse mode documents that support landmarks. (#2997) \r
 - The eSpeak synthesizer driver now handles reading by character more appropriately (e.g. announcing a foreign letter's name or value rather than just its sound or generic name). (#3106)\r
 - NVDA no longer fails to copy user settings for use on logon and other secure screens when the user's profile path contains non-ASCII characters. (#3092)\r
+- NVDA no longer freezes when using Asian character input in some .NET applications. (#3005)\r
 \r
 \r
 == Changes for Developers ==\r