eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
115 stars 134 forks source link

Drag&Drop payload differes between OS #540

Open HannesWell opened 1 year ago

HannesWell commented 1 year ago

Describe the bug

In the context of applying Oomph Setup configurations via dragging and dropping images/badges with URLs I noticed that the drag and drop payload differs between different operating-systems.

To Reproduce For example when I D&D the CREATE DEVELOPMENT ENVIRONMENT badge in https://github.com/eclipse-m2e/m2e-core#%EF%B8%8F-contributing from Firefox on Windows the D&D payload is the implemented URL and the setup is applied as expected. When I D&D the same badge from Firefox on Linux (Debian 10 Buster) the payload is the svg of the badge's image, which Oomph cannot process at that place. I also tried to D&D a similar badge from a JIRA wiki site (image from the internet with embedded link). From Firefox on Windows everything works fine, but on Linux the payload is a String that contains the URL twice separated with a newline and therefore loading of the configuration fails. At the same time when I D&D that JIRA badge on Linux to for example the Text-Editor Kate just loads the xml file pointed to with the URL (maybe Kate just ignores everything after a newline).

I debugged that down to the point where the native code is called in SWT to receive the D&D payload and therefore wonder: Is there anything in SWT that can be done in this regard or is this probably a bug in Firefox?

I have to admit that I didn't test other browser yet, but I'll do that as soon as I'm back on the Linux computer.

opcoach commented 3 days ago

Actually if we drag the 'Drag link' on this page into another tab of Safari on Mac, we get the correct URL and the set up is displayed... This is the same if we drag into a terminal...

Safari & Terminal are 2 macOS native applications that get the correct URL in their tranfer...

It seems that the swt macOS implementation has a problem to extract URL when they are transferred in a URLTransfer...

I will try a minimal example to isolate the problem...

opcoach commented 2 days ago

I created a test project on : https://github.com/opcoach/testswtmacosdroptarget

Already some strange behaviors on Mac...

opcoach commented 2 days ago

Actualy my simple example works on Mac.. I can either drop an URL transfer from my test or from a web page with the 'Drag Link' containing the install URL... May be you could used the sample to test on linux ...