mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-08 16:37:44 +02:00
Bug 350 (P2) - Restore focus to TrackPanel when play/rec is hit and the focus is in the device toolbar.
This commit is contained in:
parent
f190f7f4c6
commit
35e371878d
@ -324,6 +324,18 @@ void DeviceToolBar::EnableDisableButtons()
|
|||||||
if (gAudioIO) {
|
if (gAudioIO) {
|
||||||
// we allow changes when monitoring, but not when recording
|
// we allow changes when monitoring, but not when recording
|
||||||
bool audioStreamActive = gAudioIO->IsStreamActive() && !gAudioIO->IsMonitoring();
|
bool audioStreamActive = gAudioIO->IsStreamActive() && !gAudioIO->IsMonitoring();
|
||||||
|
|
||||||
|
// Here we should relinquish focus
|
||||||
|
if (audioStreamActive) {
|
||||||
|
wxWindow *focus = wxWindow::FindFocus();
|
||||||
|
if (focus == mHost || focus == mInput || focus == mOutput || focus == mInputChannels) {
|
||||||
|
AudacityProject *activeProject = GetActiveProject();
|
||||||
|
if (activeProject) {
|
||||||
|
activeProject->GetTrackPanel()->SetFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mHost->Enable(!audioStreamActive);
|
mHost->Enable(!audioStreamActive);
|
||||||
mInput->Enable(!audioStreamActive);
|
mInput->Enable(!audioStreamActive);
|
||||||
mOutput->Enable(!audioStreamActive);
|
mOutput->Enable(!audioStreamActive);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user