diff --git a/common/widgets/infobar.cpp b/common/widgets/infobar.cpp index e74ae93ea4..fdd8514ab3 100644 --- a/common/widgets/infobar.cpp +++ b/common/widgets/infobar.cpp @@ -161,11 +161,21 @@ void WX_INFOBAR::Dismiss() m_updateLock = false; } - +#include void WX_INFOBAR::onSize( wxSizeEvent& aEvent ) { int barWidth = GetSize().GetWidth(); + + // Calculate the horizontal size: because the infobar is shown on top of the draw canvas + // it is adjusted to the canvas width. + // On Mac, the canvas is the parent + // On other OS the parent is EDA_BASE_FRAME thta contains the canvas int parentWidth = m_parent->GetClientSize().GetWidth(); + EDA_BASE_FRAME* frame = dynamic_cast( m_parent ); + + if( frame && frame->GetToolCanvas() ) + parentWidth = frame->GetToolCanvas()->GetSize().GetWidth(); + if( barWidth != parentWidth ) SetSize( parentWidth, GetSize().GetHeight() );