]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dnd.cpp
switching to native focus handling
[wxWidgets.git] / src / mac / carbon / dnd.cpp
index 9ffa32aafaa60130b3186dcd1062320d92290ffe..5744c01f3dde21370c37ef40136328884cf5f5a9 100644 (file)
@@ -463,6 +463,11 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind
             {
                 wxPoint point(localMouse.h , localMouse.v) ;
                 wxWindow *win = NULL ;
+                ControlPartCode controlPart ;
+                ControlRef control = wxMacFindControlUnderMouse( localMouse ,
+                    theWindow , &controlPart ) ;
+                if ( control )
+                    win = wxFindControlFromMacControl( control ) ;
                 // TODO toplevel->MacGetWindowFromPointSub( point , &win ) ;
                 int localx , localy ;
                 localx = localMouse.h ;
@@ -505,7 +510,8 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind
                                 x = y = 0 ;
                                 win->MacWindowToRootWindow( &x , &y ) ;
                                 RgnHandle hiliteRgn = NewRgn() ;
-                                SetRectRgn( hiliteRgn , x , y , x+win->GetSize().x ,y+win->GetSize().y) ;
+                                Rect r = { y , x , y+win->GetSize().y , x+win->GetSize().x } ;
+                                RectRgn( hiliteRgn , &r ) ;
                                 ShowDragHilite(theDrag, hiliteRgn, true);
                                 DisposeRgn( hiliteRgn ) ;
                             }