elementary / files

File browser designed for elementary OS
https://elementary.io
GNU General Public License v3.0
322 stars 75 forks source link

Drag and drop to upload fails between Files and Epiphany #1525

Open aral opened 3 years ago

aral commented 3 years ago

What Happened

I dragged a screenshot into a message I was composing in Mastodon on Epiphany.

Even though the interface was expecting the drop, it did not register as a file upload and instead replaced my Mastodon page with the image itself.

Expected Behavior

The screenshot should have uploaded to my Mastodon.

Steps to Reproduce

  1. Open the elementary mastodon page in Epiphany
  2. Start writing a toot
  3. Drag an image from Files into your message (wait for the “drag and drop to upload” message to appear before completing the drop)

Logs

n/a

Platform Information

elementary OS 5.1.7 Hera x86_64

jeremypw commented 3 years ago

Thanks for the report. Could you advise whether you can drag/drop an image from Files into a GitHub comment with Epiphany? This works for me with Chromium browser.

aral commented 3 years ago

I just tested on Firefox and drag and drop from Files works there. This is apparently an issue with Epiphany not Files. Can someone with the correct permissions please move it there? Thanks!

jeremypw commented 3 years ago

Before doing that best try dropping from Nautilus into Epiphany.

guoxh commented 3 years ago

Same problem here, on Arch, with Epiphany 40.3-1.

guoxh commented 3 years ago

Before doing that best try dropping from Nautilus into Epiphany.

I have tried, it doesn't work.

Marukesu commented 3 years ago

This issue is a duplicate of elementary/browser#31, epiphany only declare access to the xdg-downloads folder, so drag and drop only works with files from the Downloads folder.

pedropaulosuzuki commented 3 years ago

Can confirm the issue both on Files > Epiphany and on Files > Firefox (flatpak).

When I try to drag and drop on Github, this is what happens:

file:///home/suzuki/Pictures/Screenshots/Elementary%20Photos%20low%20contrast.png

It pastes the path, instead of the picture. The same happened on Google Images. Both on GNOME Web and on Firefox, so I suspect the issue lies between Elementary Files and Flatpaks, but I could be wrong.

jeremypw commented 2 years ago

Just to note that I successfully dragged an image file from Files to a GitHub comment on the Chromium Browser (not flatpak) so I agree it is probably the flatpak sandbox which is at least partially responsible. I tried it with Gnome-Web (flatpak) and got a "This file is empty" warning from GitHub.

jeremypw commented 2 years ago

I think this is an example of a fairly long-outstanding issue with flatpak (and X?) - see https://github.com/flatpak/xdg-desktop-portal/issues/99 for some discussion and links. It sounds like with Gtk4 this should be fixed transparently. Not sure how to get the FlatPak DnD portal to work in Gtk3 though.

jhaygood86 commented 2 years ago

@jeremypw Someone familiar with GTK3 would need to backport the GTK4 portal to GTK3. The actual portal code is fairly easy to do, it's the big changes in how the clipboard works that complicates it :-/