From e71594c2369e1e3047efa74b2a912b9684a76389 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Mon, 18 Feb 2008 04:58:07 +0000 Subject: [PATCH] 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 --- src/cocoa/window.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); } // ======================================================================== -- 2.50.0