Allow time to update editor

On GTK, the full editor needs to be shown and, for some systems, the
editor will not show correctly.  By yielding we should allow the time to
recalculate sizes for the editor in the grid

Fixes https://gitlab.com/kicad/code/kicad/issues/5690
This commit is contained in:
Seth Hillbrand 2022-01-24 09:54:05 -08:00
parent 7152c4ebb8
commit 871556ebda
1 changed files with 5 additions and 9 deletions

View File

@ -503,14 +503,6 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow()
Layout();
// Workaround to fix an annoying issue on wxGTK: in some cases selecting a field
// to change its value make this value invisible. It happens until the dialog is resized.
// So I am guessing there is a problem when initializing sizers settings
// Do not create issues on other OS
wxSafeYield(); // slice of time to handle events generated when creating the
// dialog, especially size events
m_fieldsGrid->Layout(); // Force recalculating all sizers in m_fieldsGrid
return true;
}
@ -802,6 +794,10 @@ void DIALOG_SYMBOL_PROPERTIES::OnGridEditorShown( wxGridEvent& aEvent )
{
if( aEvent.GetRow() == REFERENCE_FIELD && aEvent.GetCol() == FDC_VALUE )
m_delayedSelection= true;
/// Yield here to allow events to propagate, updating editor size in GTK
/// before showing the editor FLT_MAX
wxSafeYield( this );
}