From 736fac3a51ed6e9c4ac906a731b9d35a349303e6 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 28 Apr 2004 19:24:18 +0000 Subject: [PATCH] fallback for non implemented structure region call git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26997 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 37293231db..88c4356480 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -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( ) ); -- 2.45.2