From c2bc21030fb9ff8ef1557077b3086c6751567553 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Wed, 27 Jun 2018 11:16:12 +0100 Subject: [PATCH] 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 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. --- src/Menus.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index d228c695e..1ed2161c8 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -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();