flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

[desktop_drop] MacOS - Screenshot XFiles location

Open ollyde opened this issue 3 years ago • 2 comments

When trying to read the file from a MacOS screenshot from the desktop, it errors.

  1. Use the screenshot shortcut
  2. Drag the instant screenshot into the app

Example of file /var/folders/p9/j8jkzc5j4cxfh3ckpvrg1f0h0000gn/T/TemporaryItems/NSIRD_screencaptureui_TPPuUM/Screenshot 2022-06-22 at 12.22.33.png

Screenshot 2022-06-22 at 12 24 13

ollyde avatar Jun 22 '22 10:06 ollyde

I found the error. After dropping the file into the flutter app, it sends 2 files. The first file is invalid.

Screenshot 2022-06-22 at 13 28 34

ollyde avatar Jun 22 '22 11:06 ollyde

The first invalid fileUrl read by draggingPasteboard.readObjects(forClasses: [NSURL.self], options: searchOptions)

https://github.com/MixinNetwork/flutter-plugins/blob/6b604ed71a53f1303fba4ba421ef13de1cb3f5bd/packages/desktop_drop/macos/Classes/DesktopDropPlugin.swift#L105-L110

But this was added in PR #73 which fixed #72.

I don't know how to remove this because I can not find any document for this, so let's keep this open till somebody could provider more help.

boyan01 avatar Jul 04 '22 04:07 boyan01