]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/overlay.cpp
fixing native font info support bugs
[wxWidgets.git] / src / osx / carbon / overlay.cpp
index 3ae300276a61320deb9512f375785042212fdd86..70a73399eeae3ab38d13dbbf2c002efd7f052820 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/mac/carbon/overlay.cpp
+// Name:        src/osx/carbon/overlay.cpp
 // Purpose:     common wxOverlay code
 // Author:      Stefan Csomor
 // Modified by:
@@ -60,15 +60,13 @@ void wxOverlayImpl::MacGetBounds( Rect *bounds )
     int x, y;
     x=y=0;
     m_window->MacWindowToRootWindow( &x , &y ) ;
-    WindowRef window = (WindowRef) m_window->MacGetTopLevelWindowRef() ;
+    wxNonOwnedWindow* tlw = m_window->MacGetTopLevelWindow();
+    tlw->GetNonOwnedPeer()->WindowToScreen( &x, &y );
 
-    Point localwhere = { y, x };
-    wxMacLocalToGlobal( window, &localwhere ) ;
-
-    bounds->top = localwhere.v+m_y;
-    bounds->left = localwhere.h+m_x;
-    bounds->bottom = localwhere.v+m_y+m_height;
-    bounds->right = localwhere.h+m_x+m_width;
+    bounds->top = y+m_y;
+    bounds->left = x+m_x;
+    bounds->bottom = y+m_y+m_height;
+    bounds->right = x+m_x+m_width;
 }
 
 OSStatus wxOverlayImpl::CreateOverlayWindow()