- wxPoint origin(0,0);
- origin = m_window->ClientToScreen( origin );
- bounds->top = origin.y;
- bounds->left = origin.x;
- bounds->bottom = origin.y+m_y+m_height;
- bounds->right = origin.x+m_x+m_width;
+ int x, y;
+ x=y=0;
+ m_window->MacWindowToRootWindow( &x , &y ) ;
+ WindowRef window = (WindowRef) m_window->MacGetTopLevelWindowRef() ;
+
+ 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;