Allow handling of custom formats on the Clipboard API
The current API for reading / writing to the clipboard in gtk4 requires a valid mime type as the format, however some applications make use of custom types that are not a valid mime type, just arbitrary strings.
In gtk3, it was possible to interoperate with such applications creating a GtkTargetEntry
with any string and pass it to gtk_clipboard_set_with_data
, however, in the new API, passing an invalid mime type to gdk_content_provider_new_for_bytes
and using it with gdk_clipboard_set_content
does not allow other applications to read the data.
Link to the discussion for more information: https://discourse.gnome.org/t/gtk4-clipboard-does-not-provide-contents-using-custom-mime-type-without-character/6858