removing unnecessary invalidation in Update, adding a forced update to ScrollWindow, incase we have invalid areas on the window
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2283,6 +2283,12 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
Rect scrollrect;
|
Rect scrollrect;
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
|
||||||
|
#if TARGET_API_MAC_OSX
|
||||||
|
// if there is already a pending redraw event, we first must flush that, as we don't have
|
||||||
|
// means to retrieve the dirty region of a HIView
|
||||||
|
if ( HIViewGetNeedsDisplay( (ControlRef) m_macControl ) )
|
||||||
|
Update() ;
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
wxClientDC dc(this) ;
|
wxClientDC dc(this) ;
|
||||||
wxMacPortSetter helper(&dc) ;
|
wxMacPortSetter helper(&dc) ;
|
||||||
@@ -2306,10 +2312,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
}
|
}
|
||||||
// ScrollWindowRect( (WindowRef) MacGetTopLevelWindowRef() , &scrollrect , dx , dy , kScrollWindowInvalidate, updateRgn ) ;
|
// ScrollWindowRect( (WindowRef) MacGetTopLevelWindowRef() , &scrollrect , dx , dy , kScrollWindowInvalidate, updateRgn ) ;
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
Rect before,after ;
|
|
||||||
GetRegionBounds( updateRgn , &before ) ;
|
|
||||||
HIViewConvertRegion( updateRgn , (ControlRef) MacGetTopLevelWindow()->GetHandle() , (ControlRef) m_macControl ) ;
|
HIViewConvertRegion( updateRgn , (ControlRef) MacGetTopLevelWindow()->GetHandle() , (ControlRef) m_macControl ) ;
|
||||||
GetRegionBounds( updateRgn , &after ) ;
|
|
||||||
HIViewSetNeedsDisplayInRegion( (ControlRef) m_macControl , updateRgn , true ) ;
|
HIViewSetNeedsDisplayInRegion( (ControlRef) m_macControl , updateRgn , true ) ;
|
||||||
#else
|
#else
|
||||||
// TODO TEST
|
// TODO TEST
|
||||||
@@ -2478,7 +2481,6 @@ wxString wxWindowMac::MacGetToolTipString( wxPoint &pt )
|
|||||||
void wxWindowMac::Update()
|
void wxWindowMac::Update()
|
||||||
{
|
{
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
HIViewSetNeedsDisplay( (ControlRef) m_macControl , true ) ;
|
|
||||||
WindowRef window = (WindowRef)MacGetTopLevelWindowRef() ;
|
WindowRef window = (WindowRef)MacGetTopLevelWindowRef() ;
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
|
||||||
// for composited windows this also triggers a redraw of all
|
// for composited windows this also triggers a redraw of all
|
||||||
@@ -2507,6 +2509,8 @@ void wxWindowMac::Update()
|
|||||||
OSStatus status = noErr ;
|
OSStatus status = noErr ;
|
||||||
status = ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
|
status = ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
HIViewSetNeedsDisplay( (ControlRef) m_macControl , true ) ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
::Draw1Control( (ControlRef) m_macControl ) ;
|
::Draw1Control( (ControlRef) m_macControl ) ;
|
||||||
|
Reference in New Issue
Block a user