Unable to access multiple copies of the same MIME type
I am trying to look at the way that Final Fantasy XIV (using XLCore for Linux support) uses the clipboard, because it supports some internal rich text formatting that isn't preserved in copy-paste with external apps. I'm wondering if it's possible to still make text in an internal app that pastes in the internal format, or whether that's entirely done with an internal clipboard.
After copying text in FFXIV, running wl-paste -l outputs the following:
text/plain;charset=utf-8
text/plain
text/plain
It's unclear to me whether running wl-paste -t text/plain grabs the first or second entry, but definitely there is no way to select between the two different text/plain options—and I'm suspicious that one may have the rich text.
Is there any way for me to get at the other clipboard entries?
Hi, so, the way the Wayland protocol(s) work, the source side sends us a list of formats (and sending duplicated formats in that list is weird, but I guess technically works), which is what you see in the wl-paste -l output. To actually paste, the target side asks the source for the data in a format, as a string, not an index in the original list. So we can only ask it for text/plain, and which one of the two options it picks is up to the source side then.
Final Fantasy XIV (using XLCore for Linux support)
Does that mean Wine on X11 via XWayland? If so, you could perhaps get more lucky using X11 clipboard tools (to exclude any issues with the X11<->Wayland translation), or the Wine on Wayland. The latter apparently uses this logic for mapping between Wayland MIME types and Win32 formats: https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/winewayland.drv/wayland_data_device.c#L213-228