From a054a46136f96e5a1fd68e6924dc6934813469c7 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 24 Jan 2022 15:30:25 -0800 Subject: [PATCH] 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 fddfce4fb1144450856ba728348509591a37664f) --- eeschema/dialogs/dialog_symbol_properties.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp index 58a29d8c76..56f7769933 100644 --- a/eeschema/dialogs/dialog_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_symbol_properties.cpp @@ -795,9 +795,12 @@ 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 ); + /// Queue up an event to ensure the widget gets resized if the editor needs it + wxSizeEvent *evt = new wxSizeEvent(); + evt->SetSize( wxSize( m_width, -1 ) ); + + wxQueueEvent( m_fieldsGrid, evt ); + }