Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wl-copy does not copy files under kwin #225

Open
MrDrMcCoy opened this issue Jun 7, 2024 · 5 comments
Open

wl-copy does not copy files under kwin #225

MrDrMcCoy opened this issue Jun 7, 2024 · 5 comments

Comments

@MrDrMcCoy
Copy link

When I run wl-copy -pt image/gif < bueller.gif, it exits immediately, but does not copy anything into the clipboard.
When I run wl-copy -fpt image/gif < bueller.gif, it hangs, and does not copy anything into the clipboard.

This is with version 2.2.1-1 (from Debian Trixie) under KDE 6.0.5.

Here are the outputs of WAYLAND_DEBUG=1 strace -vkinyyYo strace-wl-copy.txt wl-copy -fpt image/gif < bueller.gif:
strace-wl-copy.txt
WAYLAND_DEBUG.txt

@bugaevc
Copy link
Owner

bugaevc commented Jun 7, 2024

Hi, thanks for the clear report! So from the logs you posted it looks like it does successfully copy your GIF into the clipboard. So how do you know that it "does not copy anything into the clipboard", what are the symptoms? Are you trying to paste it somewhere (where?) and it fails to paste? (If so, it's likely that the other app/client just doesn't support pasting image/gif.) Are you able to paste using wl-paste?

@MrDrMcCoy
Copy link
Author

Symptoms are that after copying the file with wl-copy, Klipper does not show any new clipboard entries, and pasting gives me what was in there before. Doesn't matter where I paste. I've also tried with jpeg and png files, but get the same behavior.

I tried a new test just now: copying a plain text file. That successfully populates Klipper with a new entry and pasting works as expected. Seems this has something to do with binary data somehow.

@MrDrMcCoy
Copy link
Author

I was mistaken. Copying an image from another app that I can paste from never makes an entry in Klipper, and wl-copy appears to fill the clipboard with nothing, so pasting does not give me what was in there last, it's just nothing.

The example apps I tried to paste into are Slack and Discord, which definitely accept clipboard image data when copied from other apps.

@bugaevc
Copy link
Owner

bugaevc commented Jun 7, 2024

Could you try wl-paste --list-types, wl-paste > /tmp/pasted.gif?

@MrDrMcCoy
Copy link
Author

The plot thickens.

3.2ms 11:11am 06/07 $ wl-copy < Nextcloud/reactions/and\ yet.jpeg
19.7ms 11:11am 06/07 $ wl-paste --list-types; wl-paste > /tmp/pasted.jpeg
image/jpeg
17.5ms 11:11am 06/07 $ kioclient exec /tmp/pasted.jpeg

This opens a valid jpeg image in Gwenview. Pasting that immediately into Discord/Slack does nothing. Re-copying the pasted image into Slack from Gwenview gives an "unsupported file type" message, while Discord populates an empty image. Pasting into LibreOffice Draw actually gives me the image, and re-copying it again from LibreOffice allows pasting into Slack/Discord successfully.

Maybe a few bytes of metadata are getting lost and reconstructed in this process somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants