In Mac OSX, mouse button 3 is captured by the system to display the
appropriate context menu before the event is passed to the
application. Furthermore, control + mouse button 1 is interpreted as
mouse button 3 regardless of what other modifier keys are pressed.
This patch changes the handling in dragGestureRecognized to test for
OSX using the Apple-recommended test (see Detecting a Macintosh
Client in http://developer.apple.com/technotes/tn/tn2042.html\) and if
true, testing InputEvent.BUTTON1_DOWN_MASK instead of
InputEvent.BUTTON3_DOWN_MASK, then testing IsMetaDown (meta
is the java name for the Apple Command key). These tests are ORed
with the original InputEvent.BUTTON3_DOWN_MASK for all other
This patch has been tested successfully on Mac OSX version 3.6 with
Apple's Java and on Linux 2.6.3 with JRE 1.4.3.