Drag and drop from Nautilus is detected as Text, not File

Hi! I don’t know if this issue is related to Nautilus or something else.

I write programs in Kotlin with OPENRNDR, LWJGL and SDL3. When I drag images from Nautilus into my OPENRNDR program, the drop event (received via SDL3) is detected as a Text (with the path to the file). When I drop the same file from other applications, the event is received as File, not Text.

I initially thought it was an SDL issue, so I opened this. But since other drag-and-drop sources work as expected, might it be an issue in Nautilus?

In case it’s relevant: Manjaro Linux, i3wm, x11.

Hi,

Please open another gtk4 application (like gnome-text-editor), press CtrlShiftI to start the inspector, go to “Global” > “Clipboard” and drop a file from Nautilus onto the drop area. Report what displays there.

Then repeat by dragging a file from one of those “other apps that work”.

Thanks!

Hi, Thanks for the quick reply!

When I drag a file and hover over the various sections in the inspector, it shows:

From Nautilus

  • GdkFileList→ path
  • GFile→ path
  • gchararray→ path
  • (GtkTextBuffer shows Cannot display objects of type “GtkTextBuffer“)
  • text/plain;charset=utf-8→ path
  • text/uri-list→ path
  • application/vnd.portal.filetransfer→ path
  • application/vnd.portal.files→ path

From dragon-drop

  • GdkFileList→ path
  • GFile→ path
  • text/uri-list→ path
  • application/vnd.portal.filetransfer→ path
  • application/vnd.portal.files→ path
1 Like

Thanks!

Looks good on both Nautilus and other app sides.

I’ve gut feelings it’s a problem of order of evaluation on SDL side, seems they loop over the provided DnD targets, first trip on text/plain;charset=utf-8 and just use that…
But looking at their code, seems the 2 notifications may be expected, unless the 1st text/plain one actually consumes the event.

I would suggest to ask SDL how this event mechanism works and it they can manage multiple drop targets.