files icon indicating copy to clipboard operation
files copied to clipboard

Drag and drop to upload fails between Files and Epiphany

Open aral opened this issue 4 years ago • 10 comments

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

aral avatar Nov 26 '20 16:11 aral

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.

jeremypw avatar Nov 26 '20 16:11 jeremypw

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!

aral avatar Nov 26 '20 16:11 aral

Before doing that best try dropping from Nautilus into Epiphany.

jeremypw avatar Nov 26 '20 19:11 jeremypw

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

guoxh avatar Sep 27 '21 01:09 guoxh

Before doing that best try dropping from Nautilus into Epiphany.

I have tried, it doesn't work.

guoxh avatar Sep 27 '21 01:09 guoxh

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.

Marukesu avatar Sep 27 '21 17:09 Marukesu

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.

pedropaulosuzuki avatar Oct 01 '21 00:10 pedropaulosuzuki

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 avatar Oct 05 '21 15:10 jeremypw

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.

jeremypw avatar Oct 05 '21 15:10 jeremypw

@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 :-/

jhaygood86 avatar Oct 05 '21 16:10 jhaygood86