SwiftcordApp / Swiftcord

A fully native Discord client for macOS built 100% in Swift!
https://swiftcordapp.github.io/Swiftcord/
GNU General Public License v3.0
1.85k stars 84 forks source link

[Bug]: Drag and Drop doesn't work #145

Open Sjmarf opened 1 year ago

Sjmarf commented 1 year ago

Describe the Bug

When I drag a screenshot file into the Swiftcord window and let go, the image doesn't appear above the message bar. Uploading an image using the + button works just fine, and dragging from Finder works too. This bug only happens when you drag a screenshot into the window.

Reproducing the Bug

Version

0.6.0

Category

Media (images, audio, video etc.)

Relevant Log Output

No response

Screenshots

https://github.com/SwiftcordApp/Swiftcord/assets/78750526/e0350069-bd0f-4f44-93d2-4be9ba72c826

Additional Info

No response

cryptoAlgorithm commented 1 year ago

I've noticed this bug while using Swiftcord myself, and after some debugging it turns out that the issue is way more difficult to fix than expected. Turns out, images directly dragged from the small floating image on the bottom right don't have the normal document content type in the clipboard (that Swiftcord expects), but some weird ns-image (or similar, I might've forgotten) format that seems more difficult to handle. I might rework some code to handle it, but it will be very difficult to support both drop item types.