Force a size event to avoid multiple yields

When the grid editor is shown, we also want to ensure that the grid gets
resized to account for the new editor.  Queuing the event will ensure
that happens after the editor is emplaced in the grid

Fixes https://gitlab.com/kicad/code/kicad/issues/5690

(cherry picked from commit fddfce4fb1)
This commit is contained in:
Seth Hillbrand 2022-01-24 15:30:25 -08:00
parent 8426ffa238
commit a054a46136
1 changed files with 6 additions and 3 deletions

View File

@ -795,9 +795,12 @@ void DIALOG_SYMBOL_PROPERTIES::OnGridEditorShown( wxGridEvent& aEvent )
if( aEvent.GetRow() == REFERENCE_FIELD && aEvent.GetCol() == FDC_VALUE ) if( aEvent.GetRow() == REFERENCE_FIELD && aEvent.GetCol() == FDC_VALUE )
m_delayedSelection= true; m_delayedSelection= true;
/// Yield here to allow events to propagate, updating editor size in GTK /// Queue up an event to ensure the widget gets resized if the editor needs it
/// before showing the editor FLT_MAX wxSizeEvent *evt = new wxSizeEvent();
wxSafeYield( this ); evt->SetSize( wxSize( m_width, -1 ) );
wxQueueEvent( m_fieldsGrid, evt );
} }