if (tracking) { org.eclipse.swt.internal.carbon.Point outPt = new org.eclipse.swt.internal.carbon.Point (); OS.GetGlobalMouse (outPt); Rect rect = new Rect (); int window = OS.GetControlOwner (handle); OS.GetWindowBounds (window, (short) OS.kWindowContentRgn, rect); int x = outPt.h - rect.left; int y = outPt.v - rect.top; OS.GetControlBounds (parent.handle, rect); x -= rect.left; y -=  rect.top; short [] button = new short [1]; OS.GetEventParameter (theEvent, OS.kEventParamMouseButton, OS.typeMouseButton, null, 2, null, button); int chord = OS.GetCurrentEventButtonState (); int modifiers = OS.GetCurrentEventKeyModifiers (); sendMouseEvent (SWT.MouseUp, button [0], chord, (short)x, (short)y, modifiers, true); } tracking = false;
int kEventMouseDown (int nextHandler, int theEvent, int userData) {	int status = super.kEventMouseDown (nextHandler, theEvent, userData);	if (status == OS.noErr) return status;	dragging = false;	status = OS.CallNextEventHandler (nextHandler, theEvent);	if (dragging) {		Event event = new Event ();		sendEvent (SWT.Selection, event);	}	dragging = false;	return status;}