diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index e63dde07d7..7462e3ab8e 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -350,14 +350,23 @@ void wxWindowMac::DoScreenToClient(int *x, int *y) const if(x) *x = localwhere.h ; if(y) *y = localwhere.v ; - MacRootWindowToClient( x , y ) ; + MacRootWindowToWindow( x , y ) ; + if ( x ) + x -= MacGetLeftBorderSize() ; + if ( y ) + y -= MacGetTopBorderSize() ; } void wxWindowMac::DoClientToScreen(int *x, int *y) const { WindowRef window = (WindowRef) MacGetRootWindow() ; - MacClientToRootWindow( x , y ) ; + if ( x ) + x += MacGetLeftBorderSize() ; + if ( y ) + y += MacGetTopBorderSize() ; + + MacWindowToRootWindow( x , y ) ; Point localwhere = { 0,0 }; if(x) localwhere.h = * x ; @@ -1349,6 +1358,7 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa if ( win ) { point = win->ScreenToClient( point ) ; + point += win->GetClientAreaOrigin() ; return win->MacGetWindowFromPointSub( point , outWin ) ; } } diff --git a/src/mac/window.cpp b/src/mac/window.cpp index e63dde07d7..7462e3ab8e 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -350,14 +350,23 @@ void wxWindowMac::DoScreenToClient(int *x, int *y) const if(x) *x = localwhere.h ; if(y) *y = localwhere.v ; - MacRootWindowToClient( x , y ) ; + MacRootWindowToWindow( x , y ) ; + if ( x ) + x -= MacGetLeftBorderSize() ; + if ( y ) + y -= MacGetTopBorderSize() ; } void wxWindowMac::DoClientToScreen(int *x, int *y) const { WindowRef window = (WindowRef) MacGetRootWindow() ; - MacClientToRootWindow( x , y ) ; + if ( x ) + x += MacGetLeftBorderSize() ; + if ( y ) + y += MacGetTopBorderSize() ; + + MacWindowToRootWindow( x , y ) ; Point localwhere = { 0,0 }; if(x) localwhere.h = * x ; @@ -1349,6 +1358,7 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa if ( win ) { point = win->ScreenToClient( point ) ; + point += win->GetClientAreaOrigin() ; return win->MacGetWindowFromPointSub( point , outWin ) ; } }