mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 09:20:16 +01: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 commit519a202. Most of the changes in this commit were latter reverted in commit80e19f2, but not the changes to the file src/TrackPanelAx.cpp The fix is to go back to the version of TrackPanelAx.cpp in commitdb35301, the commit before519a202.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user