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

[DND] DRAG_EXIT fired AFTER DRAG_DROP / setDropDompleted(true)


    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 8u20
    • Fix Version/s: 9
    • Component/s: javafx
    • Labels:
    • Environment:

      Win 7 Pro SP1, 64 Bit, JDK 8u20


      Following the JavaDocs of the DnD event types, the normal programmer expects that no DRAG_EXIT events will get fired after DRAG_DROP (since a dragged thing cannot leave after it got dropped). In fact, I noticed on my own that I am getting DRAG_EXIT fired _after_ DRAG_DROP. This is rather unexpected and induces problems. For example, if in DRAG_DROP the object was destroyed as it was moved to the bin, some code in DRAG_EXIT could put it back on the screen by incident. It would never be possible to drop to the bin.

      This is counterintuitive. There should be no DRAG_EXIT fired after DRAG_DROP.

      Location of the problem cause is processDropEnd:

      at javafx.event.Event.fireEvent(Unknown Source)
      at javafx.scene.Scene$DnDGesture.handleExitEnter(Unknown Source)
      at javafx.scene.Scene$DnDGesture.processDropEnd(Unknown Source)
      at javafx.scene.Scene$DnDGesture.access$6600(Unknown Source)
      at javafx.scene.Scene$DragSourceListener.dragDropEnd(Unknown Source)

      I would be really glad if one could rely on DRAG_DROP really FINISHING DnD, so no more DRAG_EXIT would occur. This would make my code much simpler as DRAG_EXIT would only be a "transitional" situation, but not a terminal one _after_ having already dropped a thing.




            • Assignee:
              jgiles Jonathan Giles
              mkarg Markus Karg
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: