From 6da84b0adcbfa52fc31fd369dd2cea4d0a6375cc Mon Sep 17 00:00:00 2001 From: David Bailes Date: Fri, 17 May 2019 08:33:33 +0100 Subject: [PATCH] Keyboard prefs accessibility: Narrator can misread the radio buttons. Problem. If an item in the list is selected, then if a different view by radio button is selected, Narrator reads the selected item rather than the radio button. KeyViewAx::SetCurrentLine(int line) can be called when the KeyView is not the focus, and send a focus event. Fix: In KeyViewAx::SetCurrentLine(int line), only send focus event if the KeyView is the focus. --- src/widgets/KeyView.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/widgets/KeyView.cpp b/src/widgets/KeyView.cpp index 8dd902b3e..d8afcefdc 100644 --- a/src/widgets/KeyView.cpp +++ b/src/widgets/KeyView.cpp @@ -1931,10 +1931,12 @@ KeyViewAx::SetCurrentLine(int line) LineToId(line, mLastId); // Send notifications that the line has focus - NotifyEvent(wxACC_EVENT_OBJECT_FOCUS, - mView, - wxOBJID_CLIENT, - mLastId); + if (mView == wxWindow::FindFocus()) { + NotifyEvent(wxACC_EVENT_OBJECT_FOCUS, + mView, + wxOBJID_CLIENT, + mLastId); + } // And is selected NotifyEvent(wxACC_EVENT_OBJECT_SELECTION,