Accessibility: stop NVDA always reading track 1 after an undo or redo

Problem: the call mTrackPanel->SetFocusedTrack(NULL); in AudacityProject::OnUndo, and OnRedo cause NVDA to read the name of track one before reading the name of the track finally focused.
These calls were introduced by this commit:
Author:			llucius <llucius@47890b92-0858-11df-a26f-8b716316a5bc>
Date:			9 years ago (23/03/2009 10:56:39)
Commit hash:	bb7e9c186ab538d20ee5fa6a77da533902ec79a3
Children:		0034ab439e
Parent(s):		4ed2ff6dbf

Invalidate FocusedTrack pointer after undo/redo as it is no longer valid...I wonder if there are other cases like hits???

Fix: In TrackPanelAx, the last focused track is now stored as a weak_ptr, so these calls can be removed.
This commit is contained in:
David Bailes 2018-06-27 11:16:12 +01:00
parent 3b7fdafca8
commit c2bc21030f

View File

@ -5065,7 +5065,6 @@ void AudacityProject::OnUndo(const CommandContext &WXUNUSED(context) )
const UndoState &state = GetUndoManager()->Undo(&mViewInfo.selectedRegion);
PopState(state);
mTrackPanel->SetFocusedTrack(NULL);
mTrackPanel->EnsureVisible(mTrackPanel->GetFirstSelectedTrack());
RedrawProject();
@ -5094,7 +5093,6 @@ void AudacityProject::OnRedo(const CommandContext &WXUNUSED(context) )
const UndoState &state = GetUndoManager()->Redo(&mViewInfo.selectedRegion);
PopState(state);
mTrackPanel->SetFocusedTrack(NULL);
mTrackPanel->EnsureVisible(mTrackPanel->GetFirstSelectedTrack());
RedrawProject();