JDK-8265742 : [macos] Control+Click will invoke ACTION_COPY in a drag and drop application on MacOS
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 11,16,17
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2021-04-20
  • Updated: 2021-08-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Component reference:  java.awt.dnd.DnDConstants.ACTION_COPY

A DESCRIPTION OF THE PROBLEM :
Control+Click will invoke ACTION_COPY in a drag and drop application on MacOS but encounters the problem that is interpreted as Mouse RightClick, giving rise to conflicts.

Bug report 8242805 seems related and indicates that some part of Java does not understand that Control+Click should be considered "reserved" on MacOS, because it generates a RightClick:
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8242805

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
An application that uses ACTION_COPY on MacOS to enable selection of an item in a list, copy that item and allow the copy to be dragged to a new position in the list. The application should also have a right-click menu for the list items.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The item should be copied and dragged by a click combination that does not conflict with the OS.
ie. Control+Click should not invoke any special functions, as it is reserved by MacOS to be a synonym for RightClick.
ACTUAL -
The item can be copied using Option+Click, which is the MacOS standard for an ACTION_COPY operation (e.g. in the Finder).
However, Control+Click also works and will at the same time invoke a RightClick dropdown menu, if any.

CUSTOMER SUBMITTED WORKAROUND :
On MacOS Option+Click performs the same function, without issue.
However, the bug is still a problem, as Control+Click will not work as expected by a Mac user.


FREQUENCY : always