Prevent continuous panel resizing

When resizing the panel, it retrieves the last defined pane size
instead of the current one.  To fix this, we need to trigger the event a
second time after the pane size has been defined. This avoid calling
m_AuiPanels.Update() that crashes windows if called directly

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17835
This commit is contained in:
Dhinesh 2024-09-13 22:32:53 +05:30 committed by Seth Hillbrand
parent c736904e39
commit 3f4257139e
2 changed files with 14 additions and 0 deletions

View File

@ -484,6 +484,18 @@ void SCH_EDIT_FRAME::OnResizeHierarchyNavigator( wxSizeEvent& aEvent )
{
aEvent.Skip();
// 1st Call: Handle the size update during the first resize event.
CaptureHierarchyPaneSize();
// Defer the second size capture
CallAfter([this]() {
CaptureHierarchyPaneSize();
});
}
void SCH_EDIT_FRAME::CaptureHierarchyPaneSize()
{
// Called when resizing the Hierarchy Navigator panel
// Store the current pane size
// It allows to retrieve the last defined pane size when switching between

View File

@ -1069,6 +1069,8 @@ private:
void onNetNavigatorSelChanging( wxTreeEvent& aEvent );
void CaptureHierarchyPaneSize();
private:
// The schematic editor control class should be able to access some internal
// functions of the editor frame.