Create a global plugin containing the following code:
def chooseNVDAObjectOverlayClasses(self, obj, clsList):
Open a Windows command console.
Expected: NVDA should say terminal after announcing the console's title.
Actual: Only the title is announced.
This also happens for Scintilla editor controls.
I suspect this is because the role gets cached on the instance during the choosing of overlay classes and the cache isn't invalidated until the next core cycle. However, role is overridden by the overlay classes, thus making the cached value incorrect. To solve this, we could simply invalidate the cache after applying overlay classes. This would unfortunately often cause more cross-process calls, but I'm not sure there's anything else we can do to fix this.
The text was updated successfully, but these errors were encountered:
Comment 1 by jteh on 2012-07-31 07:54
Actually, we cache properties separately depending on which class they came from. The problem is that IAccessible.role calls super (which gets changed when overlay classes are applied) and super's value might be cached for IAccessible.role.
To generalise, the problem occurs when properties fetched before overlay classes are applied call other properties in the same object which get changed after overlay classes are applied.
The solution is to introduce another type of caching which gets invalidated after choosing overlay classes. This way, properties that call other properties (such as role) can be invalidated, while properties (such as IAcccessibleRole) that are lower level don't have to be invalidated.
Changed title from "Roles not spoken for certain focused objects when role property called in chooseNVDAObjectOverlayClasses" to "Cache potentially invalid for properties which call other properties before NVDAObject overlay classes are applied"
Comment 2 by jteh on 2012-08-03 03:18
Let's not over-generalise this. We can easily fix this particular problem by disabling caching for IAccessible.role, which makes sense because it uses lower level properties which are cached anyway.
Changed title from "Cache potentially invalid for properties which call other properties before NVDAObject overlay classes are applied" to "Roles not spoken for certain focused objects when role property called in chooseNVDAObjectOverlayClasses"