If I do a screenshot to clipboard like this:
xsnap -png -stdout | xclip -selection primary -t image/png
.....then a middle-mouse-button-paste to thunderbird yields a binary paste starting with '�PNG IHDR' and bunch of gibberish (binary data).
If I instead do a middle-mouse-button-paste to libreoffice first (yes, this works), then I can paste an image into thunderbird successfully. No explicit copy (select or ctrl-c) from libreoffice required.
I expect half the reason for this is that libreoffice modifies the selection the moment I paste there. So there is a recognizable (by thunderbird) image in the selection buffer after libreoffice is done.
But I can also do:
xsnap -png -stdout | xclip -selection primary -t image/png
xclip -selection primary -t image/png -o > beforepastetolibreoffce.png
...and insert beforepastetolibreoffce.png into thunderbird.
If I paste to libreoffice and do:
xclip -selection primary -t image/png -o > afterpastetolibreoffice.png
.... I end up with:
-rw-r--r-- 1 dagb dagb 6505 aug. 21 13:48 beforepastetolibreoffice.png
-rw-r--r-- 1 dagb dagb 27914 aug. 21 13:49 afterpastetolibreoffice.png
...confirming my theory above. libreoffice modifies the primary selection.
thunderbird is equally unhappy about the jpeg format which xclip writes to the primary selection buffer.
I believe I have an idea about what happens here. But how do I approach debugging this further? Unsure if the bug here lies with xclip or firefox, even if libreoffice can parse the selection buffer as written by xclip.