nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
Other
2.08k stars 628 forks source link

Qt 5.11+ accessibility requires updates on the NVDA side #8604

Open ghost opened 6 years ago

ghost commented 6 years ago

Qt 5.11 replaced its legacy MSAA-based Windows accessibility backend with a new implementation based on UI Automation. This seems to be causing some issues with NVDA. I'm currently investigating the following bug report, which includes a detailed description of the issues, as well as a sample project to reproduce them:

https://bugreports.qt.io/browse/QTBUG-69472

While some of the issues may result from bugs in our implementation, some others may require updates in the NVDA side, which uses a custom app module for Qt applications, which may no longer apply since Qt 5.11.

I took a look at NVDA sources and saw that it supports MSAA and UI Automation, and has app modules that add custom behavior and fixes for many applications and frameworks, including Qt. The Qt app module in NVDA is based on MSAA/IAccessible, used in previous Qt versions. When used with a Qt 5.11 application, NVDA is recognizing that it supports UI Automation and using its UI Automation module.

However, this module seems to be lacking some functionality. For instance, the automatic detection of changes in text selection seems to have been disabled for some reason. The Qt framework is raising "UIA_Text_TextSelectionChangedEventId" notifications to inform UIA clients of changes in selection. However, NVDA seems to be purposely ignoring it (the mapping from UIA_Text_TextSelectionChangedEventId to the "caret" event is commented out in the _UIAHandler.py source). Also, NVDA's UIA module uses the "EditableTextWithoutAutoSelectDetection" class, instead of the "EditableTextWithAutoSelectDetection" used on the IAccessible module. I tried enabling the UIA_Text_TextSelectionChangedEventId mapping and changing the UIA module to use EditableTextWithAutoSelectDetection, and some of the compatibility issues reported, like NVDA failing to speak the mouse selection, or the lack of updates in the Braille display where fixed. However, I'm not familiar with the NVDA code, and that change will likely break other stuff.

I would suggest keeping the current custom app module in place for supporting Qt versions prior to 5.11 and using the UIA module for >= 5.11 (i.e. whenever UIA support is detected), while enabling the necessary features to make it work properly. I can help with changes on the Qt side.

Also, please instead of creating a new custom app module for Qt 5.11+ to work around bugs in our implementation or behavior unexpected for a proper UI Automation server, please report them to us so we can have them fixed on our side instead (you can assign bug reports to me).

Note: the new accessibility backend is a pure UI Automation implementation. Legacy MSAA clients are supported through the UIA-to-MSAA bridge provided by the MS UIA framework in the middle. However, the use of the bridge was broken in the initial 5.11 release, but will be fixed in 5.11.2 (the fix is already in our 5.11 branch, if you build Qt yourself). However, the use through the bridge does not provide all functionality that may be required. In particular, it does not provide IAccessible2 support, only IAccessible. Some features like caret movement detection are in IAccessible2, so I think a proper UI Automation interfacing is the way to go, instead of trying to use it in MSAA mode (also, even going through this legacy mode would also require changes in NVDA, as it detects the UI Automation support in Qt 5.11 and seems to ignore the MSAA-based app module).

cppqtdev commented 1 year ago

Could we discuss new problems in new issues please?

I know it's tempting to post here because a Qt developer is subscribed, but the risk is that they will unsubscribe if all the comments are about NVDA bugs that happen to affect Qt software, rather than things that are actually the fault of Qt.

If you create a new issue and it does turn out to be on the Qt side rather than the NVDA side, you could leave a single comment in this thread linking to it to let subscribers know that it exists, but could we avoid having the discussion here please?

Hi @shoogle , I don't know this problem is from qt side or NVDA side . If this problem is from qt side how other screen reader read current syntax . ??

I am stuck In between that's why I post here this issue .

I also faced one another problem with NVDA . NVDA also does not properly work on slider . Only First time it read properly whenever we move the slider using the --> and <-- (left or right button) it will not speak anything while other screen reader like narrator read slider at 5 (current value of slider). But may be Qt follow windows screen reader (narrator ) only . May be Qt not focus on other screen reader how they behave on Qt controls ...

Adriani90 commented 1 year ago

@ethindp and @cppqtdev as far as I understand two issues are still open:

  1. List view is not presented correctly in NVDA, works better with other screen readers
  2. Sliders do not work with NVDA, the value is not being reported when navigating with arrow keys.

If this is correct, could you please open an issue with these two problems and attach a test application where we can reproduce the list and the slide issue? Preferably as a binary application or something that can be run without having to install the whole development environment.

That would be very appreciated.