Improve GdkAtom support that is blocking clipboard APIs
Trying to copy and paste files between apps using Gtk.Clipboard: https://people.gnome.org/~gcampagna/docs/Gtk-3.0/Gtk.Clipboard.html
For remote paths, request_uris
returns an array. Local paths only appear in request_text
output, separated by "\n"
. So far, one can copy files in Nautilus and paste them in a Gjs app.
But after I copy in my app, the "Paste" item in Nautilus context menu remains disabled.
const uris = ["file:///foo", "file:///bar"];
const clipboard = Gtk.Clipboard.get_default(Gdk.Display.get_default());
clipboard.set_text(uris.join("\n"), -1);
Pasting from my app and Nautilus to a text editor results in equal text. Apparently, the copying app needs to set a mime type on the paths it copies: https://ubuntuforums.org/archive/index.php/t-2135919.html
Docs mention set_with_data
and set_with_owner
methods on Gtk.Clipboard, but their pages return 404 and both are undefined on an object instance. How do I write to clipboard with a mime type in Gjs?