Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roles not spoken for certain focused objects when role property called in chooseNVDAObjectOverlayClasses #2569

Closed
nvaccessAuto opened this issue Jul 30, 2012 · 3 comments
Assignees
Labels
Milestone

Comments

@nvaccessAuto
Copy link

Reported by jteh on 2012-07-30 10:43
Str:

  1. Create a global plugin containing the following code:
import globalPluginHandler

class GlobalPlugin(globalPluginHandler.GlobalPlugin):
    def chooseNVDAObjectOverlayClasses(self, obj, clsList):
        obj.role
  1. Restart NVDA.
  2. Open a Windows command console.
  3. Expected: NVDA should say terminal after announcing the console's title.
  4. 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.

@nvaccessAuto
Copy link
Author

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.
Changes:
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"

@nvaccessAuto
Copy link
Author

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.
Changes:
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"

@nvaccessAuto
Copy link
Author

Comment 3 by jteh on 2012-08-03 03:26
Fixed in e6aaf42. Btw, thanks to Tyler Spivey for reporting and initial debugging.
Changes:
State: closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants