From: David Elliott Date: Mon, 18 Feb 2008 04:58:07 +0000 (+0000) Subject: Fix bug where native views with the NSScrollView wrapper would have their X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e71594c2369e1e3047efa74b2a912b9684a76389 Fix bug where native views with the NSScrollView wrapper would have their document size reset to the wx virtual size upon any size event. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51869 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/cocoa/window.mm b/src/cocoa/window.mm index bb25bcc333..fecbd8ac70 100644 --- a/src/cocoa/window.mm +++ b/src/cocoa/window.mm @@ -903,7 +903,14 @@ void wxWindowCocoaScrollView::Cocoa_FrameChanged(void) wxSizeEvent event(m_owner->GetSize(), m_owner->GetId()); event.SetEventObject(m_owner); m_owner->HandleWindowEvent(event); - UpdateSizes(); + + /* If the view is not a native one then it's being managed by wx. In this case the control + may decide to change its virtual size and we must update the document view's size to + match. For native views the virtual size will never have been set so we do not want + to use it at all. + */ + if(!m_isNativeView) + UpdateSizes(); } // ========================================================================