]> git.saurik.com Git - wxWidgets.git/commitdiff
redraw fixes for OSX
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 12 Apr 2003 18:05:17 +0000 (18:05 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 12 Apr 2003 18:05:17 +0000 (18:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/toplevel.cpp
src/mac/toplevel.cpp

index 2da89cd414782bc5d4f015bccd974fe89508cbbd..6aed5962505e3b5d423c2de6e5f496b76ee8d02d 100644 (file)
@@ -635,7 +635,20 @@ void wxTopLevelWindowMac::MacUpdate( long timestamp)
     RgnHandle       diffRgn = NewRgn() ;
     if ( updateRgn && diffRgn )
     {
     RgnHandle       diffRgn = NewRgn() ;
     if ( updateRgn && diffRgn )
     {
+#if 1
+        // macos internal control redraws clean up areas we'd like to redraw ourselves
+        // therefore we pick the boundary rect and make sure we can redraw it
+        RgnHandle trueUpdateRgn = NewRgn() ;
+        Rect trueUpdateRgnBoundary ;
+        GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), trueUpdateRgn );
+        GetRegionBounds( trueUpdateRgn , &trueUpdateRgnBoundary ) ;
+        RectRgn( (RgnHandle) updateRgn , &trueUpdateRgnBoundary ) ;
+        if ( trueUpdateRgn )
+            DisposeRgn( trueUpdateRgn ) ;
+        SetPortVisibleRegion(  GetWindowPort( (WindowRef)m_macWindow ), updateRgn ) ;
+#else
         GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn );
         GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn );
+#endif
         DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ;
         if ( !EmptyRgn( updateRgn ) )
         {
         DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ;
         if ( !EmptyRgn( updateRgn ) )
         {
@@ -815,9 +828,15 @@ void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
     // so refresh the whole window on activation and deactivation.
     long osVersion = UMAGetSystemVersion();
     if (osVersion >= 0x1000 && osVersion < 0x1020)
     // so refresh the whole window on activation and deactivation.
     long osVersion = UMAGetSystemVersion();
     if (osVersion >= 0x1000 && osVersion < 0x1020)
+    {
         Refresh(TRUE);
         Refresh(TRUE);
+    }
     else
     else
-        MacSuperEnabled( inIsActivating ) ;
+    {
+        // for the moment we have to resolve some redrawing issues like this
+        // the OS is stealing some redrawing areas as soon as it draws a control
+        Refresh(TRUE);
+    }
 }
 
 #if !TARGET_CARBON
 }
 
 #if !TARGET_CARBON
index 2da89cd414782bc5d4f015bccd974fe89508cbbd..6aed5962505e3b5d423c2de6e5f496b76ee8d02d 100644 (file)
@@ -635,7 +635,20 @@ void wxTopLevelWindowMac::MacUpdate( long timestamp)
     RgnHandle       diffRgn = NewRgn() ;
     if ( updateRgn && diffRgn )
     {
     RgnHandle       diffRgn = NewRgn() ;
     if ( updateRgn && diffRgn )
     {
+#if 1
+        // macos internal control redraws clean up areas we'd like to redraw ourselves
+        // therefore we pick the boundary rect and make sure we can redraw it
+        RgnHandle trueUpdateRgn = NewRgn() ;
+        Rect trueUpdateRgnBoundary ;
+        GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), trueUpdateRgn );
+        GetRegionBounds( trueUpdateRgn , &trueUpdateRgnBoundary ) ;
+        RectRgn( (RgnHandle) updateRgn , &trueUpdateRgnBoundary ) ;
+        if ( trueUpdateRgn )
+            DisposeRgn( trueUpdateRgn ) ;
+        SetPortVisibleRegion(  GetWindowPort( (WindowRef)m_macWindow ), updateRgn ) ;
+#else
         GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn );
         GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn );
+#endif
         DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ;
         if ( !EmptyRgn( updateRgn ) )
         {
         DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ;
         if ( !EmptyRgn( updateRgn ) )
         {
@@ -815,9 +828,15 @@ void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
     // so refresh the whole window on activation and deactivation.
     long osVersion = UMAGetSystemVersion();
     if (osVersion >= 0x1000 && osVersion < 0x1020)
     // so refresh the whole window on activation and deactivation.
     long osVersion = UMAGetSystemVersion();
     if (osVersion >= 0x1000 && osVersion < 0x1020)
+    {
         Refresh(TRUE);
         Refresh(TRUE);
+    }
     else
     else
-        MacSuperEnabled( inIsActivating ) ;
+    {
+        // for the moment we have to resolve some redrawing issues like this
+        // the OS is stealing some redrawing areas as soon as it draws a control
+        Refresh(TRUE);
+    }
 }
 
 #if !TARGET_CARBON
 }
 
 #if !TARGET_CARBON