1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 23:02:42 +02:00

Fix bug 1418 - track focus problem.

To reproduce the bug: open audacity, press r, then spacebar to record some audio. The track is not the focus - the track panel is.

This was caused by commit 519a202. Most of the changes in this commit were latter reverted in commit 80e19f2, but not the changes to the file src/TrackPanelAx.cpp

The fix is to go back to the version of TrackPanelAx.cpp in commit db35301, the commit before 519a202.
This commit is contained in:
David Bailes 2016-06-24 13:59:10 +01:00
parent 79eeb03a50
commit cf79f91da0

View File

@ -46,7 +46,12 @@ TrackPanelAx::~TrackPanelAx()
// Returns currently focused track or first one if none focused
Track *TrackPanelAx::GetFocus()
{
if( mFocusedTrack && !TrackNum( mFocusedTrack ) )
if( !mFocusedTrack )
{
SetFocus( NULL );
}
if( !TrackNum( mFocusedTrack ) )
{
mFocusedTrack = NULL;
}
@ -67,6 +72,12 @@ void TrackPanelAx::SetFocus( Track *track )
}
#endif
if( track == NULL )
{
TrackListIterator iter( mTrackPanel->mTracks );
track = iter.First();
}
mFocusedTrack = track;
#if wxUSE_ACCESSIBILITY
@ -95,8 +106,13 @@ void TrackPanelAx::SetFocus( Track *track )
// Returns TRUE if passed track has the focus
bool TrackPanelAx::IsFocused( Track *track )
{
if( !mFocusedTrack )
{
SetFocus( NULL );
}
if( ( track == mFocusedTrack ) ||
( mFocusedTrack && track == mFocusedTrack->GetLink() ) )
( track == mFocusedTrack->GetLink() ) )
{
return true;
}