-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.3
-
None
On Windows, when a Qt app opens a second window/dialog then Qt sends a Window_WindowOpened and an AutomationFocusChanged UI Automation event (instead of a Window_WindowClosed) event for the old window. This confuses accessibility tools. In particular, NVDA reads the text of the new window twice and in between it reads the old focus widget in the old window.
You should be able to reproduce this with any Qt app that opens a second window/dialog and with any accessibility tool which logs UIA events. I have patched Qt to log all calls of QAccessible::updateAccessibility and to log all UIA events that are sent by Qt.
The cause of the problem is the following:
QGuiApplicationPrivate::processFocusWindowEvent is called when a new dialog is opened (or when the active window is changed by the user) (at least on Windows). This function sends FocusOut and FocusIn events to the QWindows before calling notifyActiveWindowChange which makes the new window the active window. Therefore, on Windows, the accessible state change event did send a Window_WindowOpened and an AutomationFocusChanged (instead of a Window_WindowClosed) event for the old window.
The relevant code didn't change in Qt dev so that I'm pretty sure the problem still exists in the latest Qt.
I have patched Qt to fix this problem for Gpg4win. I'll submit this patch to codereview.qt-project.org.
For Gerrit Dashboard: QTBUG-140719 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
680696,3 | Send accessible state change event after window was made active | dev | qt/qtbase | Status: NEW | +1 | 0 |
680697,3 | Ensure that window activation events are send to QWidgetWindows | dev | qt/qtbase | Status: NEW | +1 | 0 |