Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8227371

Drag&Drop while holding the CMD key does not work on macOS

    XMLWordPrintable

Details

    Description

      A DESCRIPTION OF THE PROBLEM :
      When using drag&drop the user can hold the ALT key to perform a COPY operation, the CMD key for a MOVE operation and the ALT+CMD keys to perform a LINK operation. However on macOS the setOnDragDropped handler is not called if the user performs a MOVE operation by holding the CMD key. But it works fine on Windows. You can try that using your own code:

      1. Download HelloDragAndDrop.zip from https://docs.oracle.com/javase/8/javafx/events-tutorial/drag-drop.htm
      2. Unzip it and start it.
      3. Drag "DRAG ME" to "DRAG HERE" while holding the CMD key on the keyboard. The drag&drop operation is NOT performed. Then drag "DRAG ME" to "DRAG HERE" without holding a key. Then it works fine.
      The same happens if acceptTransferModes(TransferMode.ANY) is used.

      And because it works fine on Windows it should work fine on macOS, too.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

      1. Download HelloDragAndDrop.zip from https://docs.oracle.com/javase/8/javafx/events-tutorial/drag-drop.htm
      2. Unzip it and start it.
      3. Drag "DRAG ME" to "DRAG HERE" while holding the CMD key on the keyboard. The drag&drop operation is NOT performed. Then drag "DRAG ME" to "DRAG HERE" without holding a key. Then it works fine.
      The same happens if acceptTransferModes(TransferMode.ANY) is used.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      setOnDragDropped should be called even when holding the CMD key
      ACTUAL -
      setOnDragDropped is not called when holding the CMD key

      ---------- BEGIN SOURCE ----------
      Can be downloaded as a ZIP file at the end of Oracle's page: https://docs.oracle.com/javase/8/javafx/events-tutorial/drag-drop.htm
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I have not found a workaround. The problems seems to be in native code. View.notifyDragDrop is not called by the native code while the CMD key is pressed.

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              pbansal Pankaj Bansal (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: