Buggy code:
Listener controlListener ; Transfer [ ] transferAgents = new Transfer [ 0 ] ; DragAndDropEffect effect ; static final String DRAGSOURCEID = "DragSource" ; static Callback DragSendDataProc ; public DragSource ( Control control , int style ) { } static int checkStyle ( int style ) { } static int DragSendDataProc ( int theType , int dragSendRefCon , int theItemRef , int theDrag ) { } static DragSource FindDragSource ( int dragSendRefCon , int theDrag ) { } public void addDragListener ( DragSourceListener listener ) { } protected void checkSubclass ( ) { } void drag ( Event dragEvent ) { DNDEvent event = new DNDEvent ( ) ; event . widget = this ; event . x = dragEvent . x ; event . y = dragEvent . y ; event . time = dragEvent . time ; event . doit = true ; notifyListeners ( DragStart , event ) ; if ( ( ( ! ( event . doit ) ) || ( ( transferAgents ) == null ) ) || ( ( transferAgents . length ) == 0 ) ) return ; int [ ] theDrag = new int [ 1 ] ; if ( ( OS . NewDrag ( theDrag ) ) != ( OS . noErr ) ) { event = new DNDEvent ( ) ; event . widget = this ; event . time = ( ( int ) ( System . currentTimeMillis ( ) ) ) ; event . doit = false ; event . detail = DND . DROP_NONE ; notifyListeners ( DragEnd , event ) ; return ; } Point pt = new Point ( ) ; OS . GetGlobalMouse ( pt ) ; for ( int i = 0 ; i < ( transferAgents . length ) ; i ++ ) { int [ ] types = transferAgents [ i ] . getTypeIds ( ) ; if ( ( transferAgents [ i ] ) instanceof FileTransfer ) { TransferData transferData = new TransferData ( ) ; transferData . type = types [ 0 ] ; event = new DNDEvent ( ) ; event . widget = this ; event . time = ( ( int ) ( System . currentTimeMillis ( ) ) ) ; event . dataType = transferData ; notifyListeners ( DragSetData , event ) ; if ( ( event . data ) == null ) return ; Transfer transferAgent = transferAgents [ i ] ; for ( int j = 0 ; j < ( types . length ) ; j ++ ) { transferData . type = types [ j ] ; transferAgent . javaToNative ( event . data , transferData ) ; if ( ( transferData . result ) != ( OS . noErr ) ) return ; for ( int k = 0 ; k < ( transferData . data . length ) ; k ++ ) { byte [ ] datum = transferData . data [ k ] ; OS . AddDragItemFlavor ( theDrag [ 0 ] , ( 1 + k ) , types [ j ] , datum , datum . length , 0 ) ; } } } else { for ( int j = 0 ; j < ( types . length ) ; j ++ ) { OS . AddDragItemFlavor ( theDrag [ 0 ] , 1 , types [ j ] , null , 0 , 0 ) ; } } } OS . SetDragSendProc ( theDrag [ 0 ] , DragSource . DragSendDataProc . getAddress ( ) , control . handle ) ; int theRegion = 0 ; try { theRegion = OS . NewRgn ( ) ; <START_BUG> OS . SetRectRgn ( theRegion , ( ( short ) ( pt . h ) ) , ( ( short ) ( pt . v ) ) , ( ( short ) ( ( pt . h ) + 10 ) ) , ( ( short ) ( ( pt . v ) + 10 ) ) ) ; <END_BUG> int operations = opToOsOp ( getStyle ( ) ) ; OS . SetDragAllowableActions ( theDrag [ 0 ] , operations , true ) ; OS . SetDragAllowableActions ( theDrag [ 0 ] , operations , false ) ; ImageData imageData = effect . getDragSourceImage ( dragEvent . x , dragEvent . y ) ; Image image = null ; try { if ( imageData != null ) { image = new Image ( getDisplay ( ) , imageData ) ; CGPoint imageOffsetPt = new CGPoint ( ) ; imageOffsetPt . x = 0 ; imageOffsetPt . y = 0 ; OS . SetDragImageWithCGImage ( theDrag [ 0 ] , image . handle , imageOffsetPt , kDragStandardTranslucency ) ; } EventRecord theEvent = new EventRecord ( ) ; theEvent . message = OS . kEventMouseMoved ; theEvent . modifiers = ( ( short ) ( OS . GetCurrentEventKeyModifiers ( ) ) ) ; theEvent . what = ( ( short ) ( OS . osEvt ) ) ; theEvent . where_h = pt . h ; theEvent . where_v = pt . v ; int result = OS . TrackDrag ( theDrag [ 0 ] , theEvent , theRegion ) ; int operation = DND . DROP_NONE ; if ( result == ( OS . noErr ) ) { int [ ] outAction = new int [ 1 ] ; OS . GetDragDropAction ( theDrag [ 0 ] , outAction ) ; operation = osOpToOp ( outAction [ 0 ] ) ; } event = new DNDEvent ( ) ; event . widget = this ; event . time = ( ( int ) ( System . currentTimeMillis ( ) ) ) ; event . doit = result == ( OS . noErr ) ; event . detail = operation ; notifyListeners ( DragEnd , event ) ; } finally { if ( image != null ) image . dispose ( ) ; }

Fix:
OS . SetRectRgn ( theRegion , ( ( short ) ( pt . h ) ) , ( ( short ) ( pt . v ) ) , ( ( short ) ( ( pt . h ) + 20 ) ) , ( ( short ) ( ( pt . v ) + 20 ) ) ) ;