A more targetted fix at the focus issue.

Fixes https://gitlab.com/kicad/code/kicad/issues/5477
This commit is contained in:
Jeff Young 2020-09-08 22:32:24 +01:00
parent b1343ca281
commit 0ec4c4fe65
1 changed files with 4 additions and 1 deletions

View File

@ -243,11 +243,14 @@ void DIALOG_PAD_PROPERTIES::OnCancel( wxCommandEvent& event )
void DIALOG_PAD_PROPERTIES::autoSelectPreview( int aPage )
{
// This is the place to turn auto-select off.
// We have focus issues on GTK when we try to set the notebook page while a user is
// typing into a text control.
wxWindow* focus = FindFocus();
m_previewNotebook->ChangeSelection( aPage );
if( focus )
if( focus && dynamic_cast<wxTextEntry*>( focus ) )
focus->SetFocus();
}