summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimlich <chris@pcserenity.com>2023-11-19 14:28:07 -0500
committerChristian Heimlich <chris@pcserenity.com>2023-12-13 01:56:48 -0500
commitce5aaf1e434b6e2e482347b40524edeccecb1665 (patch)
tree3407329c84ed4cd494129f280bf39122c89c7d6b
parentec67d0c942a7756afbb6e21c76e835efd3557427 (diff)
Windows QPA: Always process system sound events
1b96c75661f678632485513d1323166bc6d74e5c reduced event noise by dropping accessibility events if Windows UI automation has not been activated; however, this did not take into account that some widgets (e.g. QMessageBox) rely on accessibility event processing to emit certain system sounds. Change notifyAccessibilityUpdate() so that system sound related events are processed regardless of accessibility activation. Pick-to: 6.5 6.6 6.7 Change-Id: I22f1516e8fbb3727b065ecc2c30b272b2d6fd1c0 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
index b9afde1067..586afeef57 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
@@ -98,11 +98,7 @@ void QWindowsUiaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event
if (!event)
return;
- // Ignore events sent before the first UI Automation
- // request or while QAccessible is being activated.
- if (!m_accessibleActive)
- return;
-
+ // Always handle system sound events
switch (event->type()) {
case QAccessible::PopupMenuStart:
playSystemSound(QStringLiteral("MenuPopup"));
@@ -117,6 +113,11 @@ void QWindowsUiaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event
break;
}
+ // Ignore events sent before the first UI Automation
+ // request or while QAccessible is being activated.
+ if (!m_accessibleActive)
+ return;
+
QAccessibleInterface *accessible = event->accessibleInterface();
if (!isActive() || !accessible || !accessible->isValid())
return;