mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 17:09:26 +02:00
TrackPanel: fix when it is set as keyboard handler.
Problem: Currently KeyboardCapture::Capture(this) is called in TrackPanel::OnTrackFocusChange(). So the keyboard handler is not automatically set when the track panel becomes the focus. Example of a symptom: A project contains a label track, and is the focus, and type to create a label is enabled. Move to focus to another window, and then back to the Audacity window. Type a character. A label is not created. Fix: Move the call KeyboardCapture::Capture(this) to TrackPanel::SetFocusedCell(), so that it gets called when the TrackPanel becomes the focus.
This commit is contained in:
parent
f327fef80b
commit
dc88fe84d9
@ -1323,6 +1323,7 @@ void TrackPanel::SetFocusedCell()
|
|||||||
{
|
{
|
||||||
// This may have a side-effet of assigning a focus if there was none
|
// This may have a side-effet of assigning a focus if there was none
|
||||||
TrackFocus::Get( *GetProject() ).Get();
|
TrackFocus::Get( *GetProject() ).Get();
|
||||||
|
KeyboardCapture::Capture(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackPanel::OnTrackFocusChange( wxCommandEvent &event )
|
void TrackPanel::OnTrackFocusChange( wxCommandEvent &event )
|
||||||
@ -1331,7 +1332,6 @@ void TrackPanel::OnTrackFocusChange( wxCommandEvent &event )
|
|||||||
auto cell = GetFocusedCell();
|
auto cell = GetFocusedCell();
|
||||||
|
|
||||||
if (cell) {
|
if (cell) {
|
||||||
KeyboardCapture::Capture(this);
|
|
||||||
Refresh( false );
|
Refresh( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user