diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index aa269504c9..a55f832d94 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -767,8 +767,18 @@ bool wxScrollHelperBase::ScrollLayout() // If we're the scroll target, take into account the // virtual size and scrolled position of the window. + wxSize size = m_win->GetVirtualSize(); + + // However we should use the real window size in the direction in which + // scrolling is disabled, if any. + const wxSize clientSize = m_win->GetClientSize(); + if ( !IsScrollbarShown(wxHORIZONTAL) ) + size.x = clientSize.x; + if ( !IsScrollbarShown(wxVERTICAL) ) + size.y = clientSize.y; + m_win->GetSizer()->SetDimension(CalcScrolledPosition(wxPoint(0, 0)), - m_win->GetVirtualSize()); + size); return true; }