SwiftcordApp / Swiftcord

A fully native Discord client for macOS built 100% in Swift!

Home Page:https://swiftcordapp.github.io/Swiftcord/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Drag and Drop doesn't work

Sjmarf opened this issue · comments

commented

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

  • Use ⌘⇧3 to take a screenshot
  • Drag the screenshot that appears in the bottom-right of the screen into Swiftcord
  • No file appears in Swiftcord

Version

0.6.0

Category

Media (images, audio, video etc.)

Relevant Log Output

No response

Screenshots

Screen.Recording.2023-05-10.at.17.53.43.mov

Additional Info

No response

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.