<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi Christopher,<div><br></div><div>This is a bug in the Mac platform code. I’ve created a JBS issue, see <a href="https://bugs.openjdk.org/browse/JDK-8325591">https://bugs.openjdk.org/browse/JDK-8325591</a>. Unfortunately I haven’t found a work-around for it.</div><div><br></div><div>Martin<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Feb 9, 2024, at 9:17 PM, Christopher Schnick <crschnick@xpipe.io> wrote:</div><br class="Apple-interchange-newline"><div>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div>
Hello,
<p>I'm using macOS Sonoma 14.3 aarch64 and I'm trying to recognize
whether a file was successfully dropped into finder from the
JavaFX application. However, the event always reports that it was
not accepted. I was under the impression that event.isAccepted()
should return true if it was successfully dropped. This is the
reproducer:<br>
</p><p><code>public class DragDrop extends Application {<br>
@Override<br>
public void start(Stage primaryStage) throws Exception {<br>
var file = Files.createTempFile("test", null);<br>
<br>
var r = new Region();<br>
r.setOnDragDetected(event -> {<br>
event.setDragDetect(true);<br>
Dragboard db =
r.startDragAndDrop(TransferMode.MOVE);<br>
var cc = new ClipboardContent();<br>
cc.putFiles(List.of(file.toFile()));<br>
db.setContent(cc);<br>
event.consume();<br>
});<br>
<br>
r.setOnDragDone(event -> {<br>
System.out.println("Accepted: " +
event.isAccepted());<br>
System.out.println(event);<br>
});<br>
<br>
var scene = new Scene(r, 450, 500);<br>
primaryStage.setScene(scene);<br>
primaryStage.setTitle("Test");<br>
primaryStage.show();<br>
}<br>
}</code></p><p><code><br>
</code></p><p>I looked through the documentation of DragEvent but I'm still not
really sure whether this is a bug. The documentation of DragEvent
is a little bit light when it comes to behavior of drag events
that go to the system itself.</p><p>Best<br>
Christopher Schnick<br>
</p>
</div>
</div></blockquote></div><br></div></body></html>