1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

Trackpanel accessibility: incorrect focus can be read

Problem: If the initial focus is a control in a toolbar, then after applying an effect such as amplify, then the focus is read as being a track, not the control in the toolbar.
TrackPanelAx::SetFocus() can be called when the TrackPanel is not the focus, and send a focus event.

Fix: In TrackPanelAx::SetFocus(), only send a focus event if the TrackPanel is the focus.
This commit is contained in:
David Bailes 2019-05-17 09:56:01 +01:00
parent 6da84b0adc
commit be55d891db

View File

@ -108,10 +108,13 @@ std::shared_ptr<Track> TrackPanelAx::SetFocus( std::shared_ptr<Track> track )
#if wxUSE_ACCESSIBILITY
if( track )
{
NotifyEvent( wxACC_EVENT_OBJECT_FOCUS,
mTrackPanel,
wxOBJID_CLIENT,
mNumFocusedTrack );
if (mTrackPanel == wxWindow::FindFocus())
{
NotifyEvent( wxACC_EVENT_OBJECT_FOCUS,
mTrackPanel,
wxOBJID_CLIENT,
mNumFocusedTrack );
}
if( track->GetSelected() )
{