OSDN Git Service

IAccessible NVDAObject's parent property: improve the hack for MSAA implementations...
authorMichael Curran <mick@kulgan.net>
Wed, 22 Sep 2010 19:14:39 +0000 (05:14 +1000)
committerMichael Curran <mick@kulgan.net>
Wed, 22 Sep 2010 19:14:39 +0000 (05:14 +1000)
source/NVDAObjects/IAccessible/__init__.py

index de00909..e8ba169 100644 (file)
@@ -820,7 +820,7 @@ the NVDAObject for IAccessible
                                #Hack around bad MSAA implementations that deliberately skip the window root IAccessible in the ancestry (Skype, iTunes)\r
                                if parentObj.windowHandle!=self.windowHandle and self.IAccessibleRole!=oleacc.ROLE_SYSTEM_WINDOW and winUser.getAncestor(self.windowHandle,winUser.GA_PARENT)==parentObj.windowHandle:\r
                                        windowObj=Window(windowHandle=self.windowHandle)\r
-                                       if windowObj and windowObj.parent==parentObj:\r
+                                       if windowObj and windowObj.IAccessibleRole==oleacc.ROLE_SYSTEM_WINDOW and windowObj.parent==parentObj:\r
                                                return windowObj\r
                        return self.correctAPIForRelation(parentObj,relation="parent") or super(IAccessible,self).parent\r
                return super(IAccessible,self).parent\r