Hopefully I'm just doing something stupidly wrong. Here's my very simple test:
var htmlFormat = DataFormat.CreateStringPlatformFormat("text/html");
var item = new DataTransferItem();
item.Set(htmlFormat, "Bold HTML Content");
//Including a text fallback did not help
//item.Set(DataFormat.Text, "Plain text fallback");
var data = new DataTransfer();
data.Add(item);
await Clipboard!.SetDataAsync(data);
All I'm trying to do is set some HTML content to the clipboard, so I can paste it in another application. But the HTML is not getting through. It will only paste the plain text when I try. It seems the HTML is getting lost somewhere somehow.
See these results from xclip after I run the above code:
xclip -selection clipboard -t TARGETS -o
TARGETS
MULTIPLE
text/html
xclip -selection clipboard -t text/html -o
Error: target text/html not available
I am able to set plain text to the clipboard just fine. Other applications (like Konsole, which I copied the above from) are able to set HTML to the clipboard which is properly paste-able.
The application is compiled with Avalonia version 12.1.1, with .NET 10.
Here are some relevant system specs:
Operating System: Debian GNU/Linux 13
KDE Plasma Version: 6.3.6
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.2
Kernel Version: 6.12.113+deb13-amd64 (64-bit)
Graphics Platform: X11
Can anyone else reproduce this, or give me some tips as to what I should try to debug it?