diff --git a/common/lib_tree_model_adapter.cpp b/common/lib_tree_model_adapter.cpp index 4d641b8deb..1716fc8400 100644 --- a/common/lib_tree_model_adapter.cpp +++ b/common/lib_tree_model_adapter.cpp @@ -48,7 +48,20 @@ public: wxSize GetSize() const override { - return wxSize( GetOwner()->GetWidth(), GetTextExtent( m_text ).y + 2 ); + wxSize size( GetOwner()->GetWidth(), GetTextExtent( m_text ).y + 2 ); + +#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 2, 7 ) + // Somehow returning 0 or negative width prevents the returned height from + // being taken into account at all, even if we return strictly positive + // width from later calls to GetSize(), meaning that it's enough to return + // 0 from it once to completely break the layout for the entire lifetime of + // the control. + // + // As this is completely unexpected, forcefully prevent this from happening + size.IncTo( wxSize( 1, 1 ) ); +#endif + + return size; } bool GetValue( wxVariant& aValue ) const override