Update Region is not always correct, we use the visible region therefore
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26459 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -133,7 +133,19 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
|
|||||||
{
|
{
|
||||||
case kEventControlDraw :
|
case kEventControlDraw :
|
||||||
{
|
{
|
||||||
RgnHandle updateRgn = cEvent.GetParameter<RgnHandle>(kEventParamRgnHandle) ;
|
RgnHandle updateRgn = NULL ;
|
||||||
|
|
||||||
|
wxRegion visRegion = thisWindow->MacGetVisibleRegion() ;
|
||||||
|
if ( cEvent.GetParameter<RgnHandle>(kEventParamRgnHandle, &updateRgn) != noErr )
|
||||||
|
{
|
||||||
|
updateRgn = (RgnHandle) visRegion.GetWXHRGN() ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// unfortunately this update region may be incorrect (tree ctrl sample )
|
||||||
|
// so we have to reset it
|
||||||
|
updateRgn = (RgnHandle) visRegion.GetWXHRGN() ;
|
||||||
|
}
|
||||||
// GrafPtr myport = cEvent.GetParameter<GrafPtr>(kEventParamGrafPort,typeGrafPtr) ;
|
// GrafPtr myport = cEvent.GetParameter<GrafPtr>(kEventParamGrafPort,typeGrafPtr) ;
|
||||||
|
|
||||||
#if 0 // in case we would need a coregraphics compliant background erase first
|
#if 0 // in case we would need a coregraphics compliant background erase first
|
||||||
@@ -1694,7 +1706,15 @@ void wxWindowMac::GetTextExtent(const wxString& string, int *x, int *y,
|
|||||||
void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect)
|
void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect)
|
||||||
{
|
{
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
|
if ( rect == NULL )
|
||||||
HIViewSetNeedsDisplay( (ControlRef) m_macControl , true ) ;
|
HIViewSetNeedsDisplay( (ControlRef) m_macControl , true ) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RgnHandle update = NewRgn() ;
|
||||||
|
SetRectRgn( update , rect->x , rect->y , rect->x + rect->width , rect->y + rect->height ) ;
|
||||||
|
SectRgn( (RgnHandle) MacGetVisibleRegion().GetWXHRGN() , update , update ) ;
|
||||||
|
HIViewSetNeedsDisplayInRegion( (ControlRef) m_macControl , update , true ) ;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if ( IsControlVisible( (ControlRef) m_macControl ) )
|
if ( IsControlVisible( (ControlRef) m_macControl ) )
|
||||||
{
|
{
|
||||||
@@ -2297,6 +2317,10 @@ wxRegion wxWindowMac::MacGetVisibleRegion( bool includeOuterStructures )
|
|||||||
*/
|
*/
|
||||||
bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
|
bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
|
||||||
{
|
{
|
||||||
|
// we let the OS handle root control redraws
|
||||||
|
if ( m_macControl == MacGetTopLevelWindow()->GetHandle() )
|
||||||
|
return false ;
|
||||||
|
|
||||||
RgnHandle updatergn = (RgnHandle) updatergnr ;
|
RgnHandle updatergn = (RgnHandle) updatergnr ;
|
||||||
bool handled = false ;
|
bool handled = false ;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user