Has any consideration been made to harmonising the...
# compose-desktop
r
Has any consideration been made to harmonising the clipboard and externalDrag APIs? Is there any ongoing discussion about evolution of these APIs? There is a lot of precedent for combining: both clipboard and drag are built on the same abstraction (
java.awt.datatransfer.Transferable
), and handling both clipboard+drag the same is how most OS APIs work too. Currently, the handy
DragData
wrapper is only exposed when content is dragged, and
Transferable.dragData(): DragData
is internal. I copied
ExternalDragAwtExtensions.kt
verbatim into my project in order to convert pasted data into
DragData
, and it works great.
1
i.e.:
Copy code
val transferable: Transferable? = Toolkit.getDefaultToolkit().systemClipboard.getContents(null)
val dragData = transferable?.dragData()
i
Should fit
Modifier.receiveContent
(not supported on CMP yet) cc @Alexander Maryanovsky
a
Yes, that API is being worked on.
🦜 3