]> git.saurik.com Git - wxWidgets.git/commitdiff
fallback for non implemented structure region call
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 28 Apr 2004 19:24:18 +0000 (19:24 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 28 Apr 2004 19:24:18 +0000 (19:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26997 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index 37293231dbd56cd342d9feb5b3731fb2fdc61386..88c4356480efc6a168cb6935521744d474f42579 100644 (file)
@@ -1587,9 +1587,14 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const
     GetRegionBounds( rgn , &content ) ;
     DisposeRgn( rgn ) ;
 #if !TARGET_API_MAC_OSX
-    Rect structure ;
-    GetControlBounds( (ControlRef) m_macControl , &structure ) ;
-    OffsetRect( &content , -structure.left , -structure.top ) ;
+    // if the content rgn is empty / not supported
+    // don't attempt to correct the coordinates to wxWindow relative ones
+    if (!::EmptyRect( &content ) )
+    {
+        Rect structure ;
+        GetControlBounds( (ControlRef) m_macControl , &structure ) ;
+        OffsetRect( &content , -structure.left , -structure.top ) ;
+    }
 #endif 
 
     return wxPoint( content.left + MacGetLeftBorderSize(  ) , content.top + MacGetTopBorderSize(  ) );