summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-10-31 12:44:48 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-11-03 18:47:38 +0100
commitd300a0fe765259d490c3510c9e2a8bac58e0aa15 (patch)
tree1cf4baab51bc53302867e43975b3efe973e82be0 /src/widgets/kernel
parent83d5a6ee620dd0f1e3064522a498864774ccaede (diff)
Revert "Accessibility: don't emit focus change when reason is window activation"
This reverts commit 79a11470f3c4c61951906223f97001a77ce36500, which resulted in QTBUG-105735. The new behavior is worse and affects multiple screen readers, while the old issue is isolated to Windows Narrator and could be considered a narrator bug. Task-number: QTBUG-105735 Pick-to: 6.2 6.4 Change-Id: Ic8be1dbd592a3fdf2c3219ec4c5524bc2c7f0f6a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 807c16875d..95fbcdc7df 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -6516,15 +6516,11 @@ void QWidget::setFocus(Qt::FocusReason reason)
QApplicationPrivate::setFocusWidget(f, reason);
#if QT_CONFIG(accessibility)
- // If the widget gets focus because its window becomes active, then the accessibility
- // subsystem is already informed about the window opening, and also knows which child
- // within the window has focus. Don't interrupt it by emitting another focus event.
- if (reason != Qt::ActiveWindowFocusReason) {
- // menus update the focus manually and this would create bogus events
- if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) {
- QAccessibleEvent event(f, QAccessible::Focus);
- QAccessible::updateAccessibility(&event);
- }
+ // menus update the focus manually and this would create bogus events
+ if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem")))
+ {
+ QAccessibleEvent event(f, QAccessible::Focus);
+ QAccessible::updateAccessibility(&event);
}
#endif
#if QT_CONFIG(graphicsview)