Copy/Paste from Wayland application to X11 application seems to fail

Hi there, I’m using a fairly fresh install of Tumbleweed with KDE Plasma (Wayland) as my DE.

Copy/paste is working fine within most apps, but when I try to paste text into a game running on Lutris, nothing happens.

Whilst looking for the cause of this, I noticed that copying from Discord to the game was fine, but Firefox, Kate, and most other apps were not.

Looking further into this, I was pointed to xclip, which as I understand should be able to output whatever’s on the X11 clipboard.

Copying some text from Firefox and running the command

xclip -o selection clipboard
Gives the output
xclip: Error: window id 0x200007 cannot convert PRIMARY selection to target ‘STRING’

Whilst copying from Discord gives the correct output

xclip -o selection clipboard
test⏎

Switching the DE from Plasma (Wayland) to Plasma (X11) makes this issue go away, xclip reports the contents of the keyboard no matter which application I copy it from.

I’m at a loose end on what to try next to get this to work. Does anyone have any suggestions on what next to try. X11 isn’t really an option here as I’m getting quite bad screen tearing using it.

Did it ever work?

Not to my knowledge.

As I said this install is pretty fresh - probably about a week old.

The command arguments are wrong. Read man xclip.

Use preformatted text to post computer output, not quotation.

This implies that xclip sees the content of the clipboard but cannot convert it. The offered format is determined by the provider. You can use

xclip -o -selection clipboard -t TARGETS

to list the offered formats. I get different error:

bor@uefi:~> xclip -o -selection clipboard
xclip: Error: There is no owner for the CLIPBOARD selection
bor@uefi:~> 

It works for -selection primary.

I have slightly outdated KDE (Tumbleweed 20251007 with KDE 6.4.5).

Copying how exactly? X11 understands PRIMARY selection and CLIPBOARD. It depends on the application which one it is using.

What happens when you try to select text in konsole and access it using xclip -selection primary?

I get the same here

ransom@Kattegaud ~ [1]> xclip -o -selection clipboard -t TARGETS
xclip: Error: window id 0x200005 cannot convert CLIPBOARD selection to target 'TARGETS'
ransom@Kattegaud ~ [1]> xclip -o -selection primary
xclip: Error: window id 0x200007 cannot convert PRIMARY selection to target 'STRING'

Copying how exactly? X11 understands PRIMARY selection and CLIPBOARD. It depends on the application which one it is using.

Ctrl + C after selecting text in the application.

What happens when you try to select text in konsole and access it using xclip -selection primary?

If I select text in Konsole - and then run

ransom@Kattegaud ~ [1]> xclip -o -selection primary
xclip: Error: window id 0x200007 cannot convert PRIMARY selection to target 'STRING'

Likewise I get the same output if I select text in konsole, right click the selection and click copy then run the same command

xclip is for X11, this is what man X11 has to say about it:

xclip - command line interface to X selections (clipboard)

For Wayland there is wl-clipboard that provides:

> rpm -ql wl-clipboard | head -n2
/usr/bin/wl-copy
/usr/bin/wl-paste

You probably have to install the package as it is not installed by default.

This topic is about interoperability between native Wayland and native X11/Xwayland clients. xclip is just the simplest way to demonstrate the problem.

@RansomTime try new clean user - do you still see the same problem?

1 Like

Created a new user account, logged in and tested this.

I still get the same problem, yes - the xclip output gives the same “cannot convert” message and pasting does not work into the game I’m trying to run.

I updated my KDE VM to the latest snapshot and I now see the same problem. I submitted 1252986 – Copy-paste between native Wayland and native X11 clients stopped working on KDE. You may still consider asking on KDE forums, if anything you can get better guidance how to troubleshoot this issue. If you get any useful information from KDE, consider updating this bug report.

Hello,

I might have the same issue with VirtualBox, which is an X11 application running on my KDE wayland desktop.
I hadn’t realized it before, but it could be the same problem.

Copy from kde (wayland) to virtualbox (x11) does not work, from virtualbox (x11) to wayland seems to work.

https://bugs.kde.org/show_bug.cgi?id=511306