#endif
#include "wx/mac/uma.h"
+#if TARGET_API_MAC_OSX
+#include "wx/toplevel.h"
+#endif
// since we have decided that we only support 8.6 upwards we are
// checking for these minimum requirements in the startup code of
Rect* UMAGetControlBoundsInWindowCoords(ControlRef theControl, Rect *bounds)
{
-// wxWindow* win = wxFindControlFromMacControl( theControl ) ;
-
GetControlBounds( theControl , bounds ) ;
#if TARGET_API_MAC_OSX
WindowRef tlwref = GetControlOwner( theControl ) ;
- wxWindow* tlwwx = (wxWindow*) wxFindWinFromMacWindow( tlwref ) ;
- ControlRef rootControl = tlwwx->GetPeer()->GetControlRef() ;
-
- HIPoint hiPoint = CGPointMake( 0 , 0 ) ;
- HIViewConvertPoint( &hiPoint , HIViewGetSuperview(theControl) , rootControl ) ;
- OffsetRect( bounds , (short) (hiPoint.x) , (short) (hiPoint.y) ) ;
+ wxTopLevelWindowMac* tlwwx = wxFindWinFromMacWindow( tlwref ) ;
+ if ( tlwwx->MacUsesCompositing() )
+ {
+ ControlRef rootControl = tlwwx->GetPeer()->GetControlRef() ;
+ HIPoint hiPoint = CGPointMake( 0 , 0 ) ;
+ HIViewConvertPoint( &hiPoint , HIViewGetSuperview(theControl) , rootControl ) ;
+ OffsetRect( bounds , (short) hiPoint.x , (short) hiPoint.y ) ;
+ }
#endif
return bounds ;
}