SUMMARY When calling SetSelection, the SelectionTransfer signal will only ever send "text/plain" as the mime_type. STEPS TO REPRODUCE 1. Call SetSelection with mime_types = [ "text/plain;charset=utf-8", "text/plain" ] 2. Wait for SelectionTransfer signal OBSERVED RESULT mime_type will always be "text/plain", limiting usage to ASCII characters only. EXPECTED RESULT The protocol is not clear if there is some kind of implied priority with the mime_types, but I would expect utf-8 to be preferred over ASCII. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora 43 KDE Plasma Version: 6.5.1 KDE Frameworks Version: 6.19.0 Qt Version: 6.10.0 xdg-desktop-portal-kde-6.5.2-1 (+ patch https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/b7f2107d0eb35d2b4cfccf9ffaa91437b88eff0a) ADDITIONAL INFORMATION I have tested calling SetSelection with mime_types set to [ "text/plain;charset=utf-8" ]. But when I do that, the SelectionTransfer signal is never transmitted.
Doesn't this depend on the side wanting to read the data? We dont have code special casing mimetypes in the portal for what it's worth, it's either lower in the stack or the process reading the clipboard.
I would assume (In reply to David Redondo from comment #1) > Doesn't this depend on the side wanting to read the data? Yeah that is what I would assume. Maybe I'm just misunderstanding the protocol and have implemented things incorrectly, but this is how things happen with my current setup: 1. I call SetSelection and set mime_types to ["text/plain;charset=utf-8", "text/plain"]. 2. Directly after calling SetSelection, the SelectionTransfer signal is emitted, where the mime_type is always "text/plain". Is the transfer supposed to be instant? My guess would be that, just as you say, an application makes a request for an available mime type, which then should trigger a transfer.
the clipboard manager will instantly request the data.
Alright got it, thanks for clarifying. Are you able to get a SelectionTransfer signal with mime_type set to "text/plain;charset=utf-8" in SetSelection? It just won't work in my testing :/
I can reproduce, it should be fixed already by https://invent.kde.org/frameworks/kguiaddons/-/commit/20b032c87b8d15228d99d162818e51c216054010
Oh, I did not notice that it had already been fixed. I will patch and test again, thanks!
Ok so I just tested with xdg-desktop-portal-kde-d64493551ba28dd0b73dfdddd51d3efa41caa4da The issue still remains for me: 1. Call SetSelection with mime_types = [ "text/plain;charset=utf-8" ] 2. I never get a SelectionTransfer signal 1. Call SetSelection with mime_types = [ "text/plain;charset=utf-8", "text/plain" ] 2. SelectionTransfer is always called with mime_types = "text/plain". Do you have a setup where SelectionTransfer works with utf-8?
Hi, the fix was only released on friday with frameworks 6.20. I just tested and with that I get SelectionTransfer with utf8. I am gonna close it as fixed.
Just ran an update, work fine now. Thanks!