X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9879fa842c547647e0956035e46503f9e3523f09..86b79b93fbbb0c2e90e6595f7fea0f979b80881c:/src/cocoa/window.mm diff --git a/src/cocoa/window.mm b/src/cocoa/window.mm index 0259aa8de3..7778c84c39 100644 --- a/src/cocoa/window.mm +++ b/src/cocoa/window.mm @@ -22,6 +22,9 @@ #import #import #import +#import + +#include // Turn this on to paint green over the dummy views for debugging #undef WXCOCOA_FILL_DUMMY_VIEW @@ -147,6 +150,7 @@ bool wxWindowCocoaHider::Cocoa_drawRect(const NSRect& rect) wxWindowCocoaScroller::wxWindowCocoaScroller(wxWindow *owner) : m_owner(owner) { + wxAutoNSAutoreleasePool pool; wxASSERT(owner); wxASSERT(owner->GetNSView()); m_cocoaNSScrollView = [[NSScrollView alloc] @@ -345,8 +349,21 @@ bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect) wxLogDebug(wxT("Paint event recursion!")); return false; } - //FIXME: should probably turn that rect into the update region m_isInPaint = TRUE; + + // Set m_updateRegion + const NSRect *rects = ▭ // The bounding box of the region + int countRects = 1; + // Try replacing the larger rectangle with a list of smaller ones: +NS_DURING + // This only works on Panther +// [GetNSView() getRectsBeingDrawn:&rects count:&countRects]; + // This compiles everywhere (and still only works on Panther) + objc_msgSend(GetNSView(),@selector(getRectsBeingDrawn:count:),&rects,&countRects); +NS_HANDLER +NS_ENDHANDLER + m_updateRegion = wxRegion(rects,countRects); + wxPaintEvent event(m_windowId); event.SetEventObject(this); bool ret = GetEventHandler()->ProcessEvent(event);