Buggy code:
public Color getSystemColor ( int id ) { } public Cursor getSystemCursor ( int id ) { } public Image getSystemImage ( int id ) { } public Tray getSystemTray ( ) { } public Thread getThread ( ) { } Widget getWidget ( int handle ) { } int helpProc ( int inControl , int inGlobalMouse , int inRequest , int outContentProvided , int ioHelpContent ) { } int hitTestProc ( int browser , int item , int property , int theRect , int mouseRect ) { } protected void init ( ) { } void initializeCallbacks ( ) { } void initializeFonts ( ) { } void initializeInsets ( ) { } void initializeWidgetTable ( ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int context , GCData data ) { } static boolean isValidClass ( Class clazz ) { } boolean isValidThread ( ) { } int itemCompareProc ( int browser , int itemOne , int itemTwo , int sortProperty ) { } int itemDataProc ( int browser , int item , int property , int itemData , int setValue ) { } int itemNotificationProc ( int browser , int item , int message ) { } int keyboardProc ( int nextHandler , int theEvent , int userData ) { } public boolean post ( Event event ) { } void postEvent ( Event event ) { } public Point map ( Control from , Control to , Point point ) { } public Point map ( Control from , Control to , int x , int y ) { } public Rectangle map ( Control from , Control to , Rectangle rectangle ) { } public Rectangle map ( Control from , Control to , int x , int y , int width , int height ) { } int menuProc ( int nextHandler , int theEvent , int userData ) { } int mouseProc ( int nextHandler , int theEvent , int userData ) { } int mouseHoverProc ( int id , int handle ) { } int [ ] readImageRef ( int path ) { } public boolean readAndDispatch ( ) { } static synchronized void register ( Display display ) { } protected void release ( ) { } void releaseDisplay ( ) { } public void removeFilter ( int eventType , Listener listener ) { } public void removeListener ( int eventType , Listener listener ) { } void removeMenu ( Menu menu ) { } void removePopup ( Menu menu ) { } Widget removeWidget ( int handle ) { } boolean runAsyncMessages ( boolean all ) { } boolean runEnterExit ( ) { } boolean runDeferredEvents ( ) { } boolean runEventLoopTimers ( ) { } boolean runGrabs ( ) { if ( ( ( grabControl ) == null ) || ( grabbing ) ) return false ; if ( ! ( OS . StillDown ( ) ) ) { grabControl = null ; return false ; } Rect rect = new Rect ( ) ; int [ ] outModifiers = new int [ 1 ] ; short [ ] outResult = new short [ 1 ] ; CGPoint pt = new CGPoint ( ) ; Point outPt = new Point ( ) ; grabbing = true ; mouseUpControl = null ; try { while ( ( ( ( grabControl ) != null ) && ( ! ( grabControl . isDisposed ( ) ) ) ) && ( ( outResult [ 0 ] ) != ( OS . kMouseTrackingMouseUp ) ) ) { if ( ! ( OS . HIVIEW ) ) grabControl . getShell ( ) . update ( true ) ; lastModifiers = OS . GetCurrentEventKeyModifiers ( ) ; int oldState = OS . GetCurrentEventButtonState ( ) ; int handle = grabControl . handle ; int window = OS . GetControlOwner ( handle ) ; int port = ( OS . HIVIEW ) ? - 1 : OS . GetWindowPort ( window ) ; <START_BUG> OS . TrackMouseLocationWithOptions ( port , kTrackMouseLocationOptionDontConsumeMouseUp , ( 50 // 1000.0 ) , outPt , outModifiers , outResult ) ; <END_BUG> int type = 0 ; int button = 0 ; switch ( ( ( int ) ( outResult [ 0 ] ) ) ) { case OS . kMouseTrackingTimedOut : { runAsyncMessages ( false ) ; break ; } case OS . kMouseTrackingMouseDown : { type = SWT . MouseDown ; int newState = OS . GetCurrentEventButtonState ( ) ; if ( ( ( oldState & 1 ) == 0 ) && ( ( newState & 1 ) != 0 ) ) button = 1 ; if ( ( ( oldState & 2 ) == 0 ) && ( ( newState & 2 ) != 0 ) ) button = 2 ; if ( ( ( oldState & 4 ) == 0 ) && ( ( newState & 4 ) != 0 ) ) button = 3 ; break ; } case OS . kMouseTrackingMouseUp : { type = SWT . MouseUp ; int newState = OS . GetCurrentEventButtonState ( ) ; if ( ( ( oldState & 1 ) != 0 ) && ( ( newState & 1 ) == 0 ) ) button = 1 ; if ( ( ( oldState & 2 ) != 0 ) && ( ( newState & 2 ) == 0 ) ) button = 2 ; if ( ( ( oldState & 4 ) != 0 ) && ( ( newState & 4 ) == 0 ) ) button = 3 ; break ; } case OS . kMouseTrackingMouseDragged : { mouseMoved = true ; type = SWT . MouseMove ; dragDetect ( grabControl ) ; break ; } case OS . kMouseTrackingMouseKeyModifiersChanged : break ; case OS . kMouseTrackingUserCancelled : break ; case OS . kMouseTrackingMouseMoved : { mouseMoved = true ; type = SWT . MouseMove ; break ; } }

Fix:
OS . TrackMouseLocationWithOptions ( port , kTrackMouseLocationOptionDontConsumeMouseUp , ( 10 // 1000.0 ) , outPt , outModifiers , outResult ) ;