From 871556ebda21b1cdcbf6c6de4f00dbe02b780387 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 24 Jan 2022 09:54:05 -0800 Subject: [PATCH] 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 --- eeschema/dialogs/dialog_symbol_properties.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp index 1d93632bf3..6defad1fea 100644 --- a/eeschema/dialogs/dialog_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_symbol_properties.cpp @@ -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 ); } @@ -1104,4 +1100,4 @@ void DIALOG_SYMBOL_PROPERTIES::OnCheckBox( wxCommandEvent& event ) void DIALOG_SYMBOL_PROPERTIES::OnChoice( wxCommandEvent& event ) { OnModify(); -} \ No newline at end of file +}