summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré de la Rocha <andre.rocha@qt.io>2022-08-30 17:49:32 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-02 16:31:45 +0000
commitbff012b53f52ec31740e14b70af3755390cb218a (patch)
tree01716e644a6c8ec33dc0ec91b7ce9b43d92f7470
parentc7ce952d6fcc033bd344acaa4caa95ee958687c9 (diff)
Windows QPA: send UIA focus notification after window activation
After a Qt application window was opened, and focus was moved to another window, and then back to the Qt application window, NVDA would only announce the window name, but not the widget focused within the window. This patch makes Qt send a notification focus for the focused widget after a window activation notification. Fixes: QTBUG-105735 Change-Id: I3426b3613ae546de0ce363f9acc5d6776c99a8aa Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 3e95884081727b84df265e2fa3456f2393e61f7b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
index e75f9a3839..03cac60e08 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
@@ -103,6 +103,10 @@ void QWindowsUiaMainProvider::notifyStateChange(QAccessibleStateChangeEvent *eve
if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) {
if (accessible->state().active) {
QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_Window_WindowOpenedEventId);
+ if (QAccessibleInterface *focused = accessible->focusChild()) {
+ if (QWindowsUiaMainProvider *focusedProvider = providerForAccessible(focused))
+ QWindowsUiaWrapper::instance()->raiseAutomationEvent(focusedProvider, UIA_AutomationFocusChangedEventId);
+ }
} else {
QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_Window_WindowClosedEventId);
}