X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..2d4e4f802f8a165c8d41053d2cd6d33c32b08f79:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index f65fb4b487..4da24ea311 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -344,18 +344,32 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, // here not just the size. It makes SetScrollbars 'sticky' // emulating the old non-autoscroll behaviour. - m_targetWindow->SetVirtualSizeHints( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY ); + wxSize sz = m_targetWindow->GetClientSize(); +#if 1 + int x = wxMax(noUnitsX * pixelsPerUnitX, sz.x); + int y = wxMax(noUnitsY * pixelsPerUnitY, sz.y); +#else + int x = noUnitsX * pixelsPerUnitX; + int y = noUnitsY * pixelsPerUnitY; +#endif + m_targetWindow->SetVirtualSizeHints( x, y ); // The above should arguably be deprecated, this however we still need. - m_targetWindow->SetVirtualSize( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY ); + m_targetWindow->SetVirtualSize( x, y ); if (do_refresh && !noRefresh) m_targetWindow->Refresh(TRUE, GetRect()); + // TODO: check if we can use AdjustScrollbars always. +#ifdef __WXUNIVERSAL__ + AdjustScrollbars(); +#else + // This is also done by AdjustScrollbars, above #ifdef __WXMAC__ m_targetWindow->MacUpdateImmediately() ; #endif +#endif } // ----------------------------------------------------------------------------