From 5f3f23462e7990800b7d93daecd4ab8e895ef036 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Tue, 14 Jul 2020 22:37:59 -0300 Subject: [PATCH] Allow Windows accessibility backend to receive focus updates The removed code no longer applies to the current Windows accessibility backend, and was causing it to miss focus change events when the application UI contained one or more widgets associated with native window handles, or when the Qt::AA_NativeWindows application attribute was set. This caused accessibility tools like Narrator to miss changes in the focused widget. Fixes: QTBUG-81862 Pick-to: 5.15 Change-Id: I6e42d09c54e9e1338fc4b103eba8a0b2c4309e7f Reviewed-by: Volker Hilsheimer Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff --- src/widgets/kernel/qwidget.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 01755e01c7..0eb929f600 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6349,11 +6349,6 @@ void QWidget::setFocus(Qt::FocusReason reason) QApplicationPrivate::setFocusWidget(f, reason); #ifndef QT_NO_ACCESSIBILITY -# ifdef Q_OS_WIN - // The negation of the condition in setFocus_sys - if (!(testAttribute(Qt::WA_WState_Created) && window()->windowType() != Qt::Popup && internalWinId())) - //setFocusWidget will already post a focus event for us (that the AT client receives) on Windows -# endif // menus update the focus manually and this would create bogus events if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) {