Buggy code:
if ( ! ( OS . HIVIEW ) ) { OS . GetControlBounds ( handle , rect ) ; startX -= rect . left ; startY -= rect . top ; } Event event = new Event ( ) ; event . x = startX ; event . y = startY ; event . width = width ; event . height = height ; sendEvent ( Selection , event ) ; if ( isDisposed ( ) ) return result ; if ( ! ( event . doit ) ) return result ; int offsetX ; int offsetY ; int window = OS . GetControlOwner ( handle ) ; if ( OS . HIVIEW ) { CGPoint pt = new CGPoint ( ) ; OS . GetEventParameter ( theEvent , kEventParamWindowMouseLocation , typeHIPoint , null , sizeof , null , pt ) ; OS . HIViewConvertPoint ( pt , 0 , handle ) ; offsetX = ( ( int ) ( pt . x ) ) ; offsetY = ( ( int ) ( pt . y ) ) ; } else { int sizeof = org . eclipse . swt . internal . carbon . Point . sizeof ; org . eclipse . swt . internal . carbon . Point pt = new org . eclipse . swt . internal . carbon . Point ( ) ; OS . GetEventParameter ( theEvent , kEventParamMouseLocation , typeQDPoint , null , sizeof , null , pt ) ; OS . GetWindowBounds ( window , ( ( short ) ( kWindowContentRgn ) ) , rect ) ; offsetX = ( pt . h ) - ( rect . left ) ; offsetY = ( pt . v ) - ( rect . top ) ; OS . GetControlBounds ( handle , rect ) ; offsetX -= rect . left ; offsetY -= rect . top ; } int port = ( OS . HIVIEW ) ? - 1 : OS . GetWindowPort ( window ) ; int [ ] outModifiers = new int [ 1 ] ; short [ ] outResult = new short [ 1 ] ; CGPoint pt = new CGPoint ( ) ; org . eclipse . swt . internal . carbon . Point outPt = new org . eclipse . swt . internal . carbon . Point ( ) ; while ( ( outResult [ 0 ] ) != ( OS . kMouseTrackingMouseUp ) ) { OS . TrackMouseLocationWithOptions ( port , 0 , kEventDurationForever , outPt , outModifiers , outResult ) ; switch ( outResult [ 0 ] ) { case OS . kMouseTrackingMouseDown : case OS . kMouseTrackingMouseUp : case OS . kMouseTrackingMouseDragged : { int x ; int y ; if ( OS . HIVIEW ) { OS . GetWindowBounds ( window , ( ( short ) ( kWindowStructureRgn ) ) , rect ) ; pt . x = ( outPt . h ) - ( rect . left ) ; pt . y = ( outPt . v ) - ( rect . top ) ; OS . HIViewConvertPoint ( pt , 0 , handle ) ; x = ( ( int ) ( pt . x ) ) ; y = ( ( int ) ( pt . y ) ) ; } else { OS . GetControlBounds ( handle , rect ) ; x = ( outPt . h ) - ( rect . left ) ; y = ( outPt . v ) - ( rect . top ) ; } int newX = startX ; int newY = startY ; if ( ( ( style ) & ( SWT . VERTICAL ) ) != 0 ) { int clientWidth = ( rect . right ) - ( rect . left ) ; newX = Math . min ( Math . max ( 0 , ( x - offsetX ) ) , ( clientWidth - width ) ) ; } else { int clientHeight = ( rect . bottom ) - ( rect . top ) ; newY = Math . min ( Math . max ( 0 , ( y - offsetY ) ) , ( clientHeight - height ) ) ; } event = new Event ( ) ; event . x = newX ; event . y = newY ; event . width = width ; event . height = height ; sendEvent ( Selection , event ) ; if ( isDisposed ( ) ) return result ; if ( event . doit ) { setBounds ( event . x , event . y , width , height ) ; if ( isDisposed ( ) ) return result ; if ( ! ( OS . HIVIEW ) ) parent . update ( true ) ; } if ( ( outResult [ 0 ] ) == ( OS . kMouseTrackingMouseUp ) ) { OS . GetControlBounds ( handle , rect ) ; short [ ] button = new short [ 1 ] ; OS . GetEventParameter ( theEvent , kEventParamMouseButton , typeMouseButton , null , 2 , null , button ) ; int chord = OS . GetCurrentEventButtonState ( ) ; int modifiers = OS . GetCurrentEventKeyModifiers ( ) ; <START_BUG> sendMouseEvent ( MouseUp , button [ 0 ] , true , chord , ( ( short ) ( x - ( rect . left ) ) ) , ( ( short ) ( y - ( rect . top ) ) ) , modifiers ) ; <END_BUG> } break ; } default : outResult [ 0 ] = OS . kMouseTrackingMouseUp ; break ; } } return OS . noErr ; } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } int kEventUnicodeKeyPressed ( int nextHandler , int theEvent , int userData ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } int traversalCode ( int key , int theEvent ) { } }

Fix:
sendMouseEvent ( MouseUp , button [ 0 ] , clickCount , true , chord , ( ( short ) ( x - ( rect . left ) ) ) , ( ( short ) ( y - ( rect . top ) ) ) , modifiers ) ;