GNOME Bugzilla – Bug 314120
clipboard should support text/uri-list for file copy/past for interoperability with other applications
Last modified: 2021-06-18 15:12:59 UTC
When copying and pasting files in nautilus it only publishes and accepts a special x-special/gnome-copied-files target. To make interoperability with other applications better it should also publish and accept the text/uri-list target for copying and pasting files. See also http://freedesktop.org/Standards/file-uri-spec In particular this would make copying and pasting files to and from nautilus and applications that use the new GNU Classpath gtk+ awt.datatransfer implementation possible.
Thanks for your bug report! If I got the code right, we essentialy use URI lists for our internal dnd target, except that the first line flags whether we move or copy files. Maybe you could describe more in detail what we still lack wrt interoperability? I can find many references to the "text/uri-list" drag/drop target in the nautilus source.
nautilus does support uri-lists in the drag/drop targets, but not in the copy/paste targets. That means you can drag/drop files to other applications that support text/uri-list, but not copy/paste them since when using copy/paste nautilus only supports x-special/gnome-copied-file and clear text targets which are not understood by other applications as file/url references. In the case I am interested in (GNU Classpath based programs) there is only copy/paste support and not drag-and-drop (yet, hopefully, but that will take some time).
OK, sounds reasonable. Should we move or copy text/uri-list items when pasting?
Created attachment 112317 [details] [review] patch Part 1: put text targets and text/uri-list target on clipboard
Thanks for your efforts. Feel free to commit the patch to trunk.
* src/file-manager/fm-directory-view.c: (convert_file_list_to_string), (get_clipboard_callback), (clear_clipboard_callback), (convert_file_list_to_uris), (copy_or_cut_files), (clipboard_targets_received), (real_update_paste_menu), (fm_directory_view_class_init): * src/file-manager/fm-tree-view.c: (get_clipboard_callback), (clear_clipboard_callback), (convert_file_to_uri), (copy_or_cut_files): Store the clipboard selection also in text/uri-list format. Part of bug #314120. Not closing the bug since that's only part of the fix, not complete. What's still needed is for nautilus to accept text/uri-list when pasting the selection (as copy, or move). Not sure how to transport the desired action... maybe with special text/uri-list;action=copy|move|ask targets? Needs to be coordinated with xdg, I guess.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of Files (nautilus), then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/nautilus/-/issues/ Thank you for your understanding and your help.