From 51c7381fd54871c73ee0f52a97c09382fd5771ab Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 6 Jun 2018 08:47:53 +0200 Subject: [PATCH] Fix Choose Symbol dialog freezes in eeschema Scrollbars are always enabled to prevent an infinite event loop caused by alternating CreateLayout() and OnSize event handler. More details: http://trac.wxwidgets.org/ticket/18141 Fixes: lp:1767848 * https://bugs.launchpad.net/kicad/+bug/1767848 --- eeschema/widgets/component_tree.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eeschema/widgets/component_tree.cpp b/eeschema/widgets/component_tree.cpp index 5f90ba983f..e5cf8f0c77 100644 --- a/eeschema/widgets/component_tree.cpp +++ b/eeschema/widgets/component_tree.cpp @@ -85,6 +85,7 @@ COMPONENT_TREE::COMPONENT_TREE( wxWindow* aParent, SYMBOL_LIB_TABLE* aSymLibTabl if( !aDetails ) { auto html_sz = ConvertDialogToPixels( wxPoint( 80, 80 ) ); + m_details_ctrl = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxSize( html_sz.x, html_sz.y ), wxHW_SCROLLBAR_AUTO ); @@ -95,6 +96,7 @@ COMPONENT_TREE::COMPONENT_TREE( wxWindow* aParent, SYMBOL_LIB_TABLE* aSymLibTabl { m_details_ctrl = aDetails; } + m_details_ctrl->Bind( wxEVT_HTML_LINK_CLICKED, &COMPONENT_TREE::onDetailsLink, this ); } @@ -120,6 +122,12 @@ COMPONENT_TREE::COMPONENT_TREE( wxWindow* aParent, SYMBOL_LIB_TABLE* aSymLibTabl Layout(); sizer->Fit( this ); + +#ifdef __WXGTK__ + // Scrollbars must be always enabled to prevent an infinite event loop + // more details: http://trac.wxwidgets.org/ticket/18141 + m_details_ctrl->ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS ); +#endif /* __WXGTK__ */ }