Bug 511063 - Clipboard contents will not paste into Wine
Summary: Clipboard contents will not paste into Wine
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: xwayland (other bugs)
Version First Reported In: 6.5.0
Platform: Arch Linux Linux
: VHI normal
Target Milestone: ---
Assignee: Vlad Zahorodnii
URL:
Keywords: regression, wayland-only
: 511325 511375 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-10-25 02:00 UTC by jcyphers
Modified: 2025-11-13 17:51 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.5.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jcyphers 2025-10-25 02:00:01 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
After upgrading to KDE 6.5 on CachyOS (Arch) clipboard contents will no longer paste into programs installed through Wine.  This worked fine prior to the upgrade.

STEPS TO REPRODUCE
1. Copy text to clipboard
2. Open Wine installed software (such as a game in this instance)
3. Paste with <ctrl>V

OBSERVED RESULT
Nothing happens

EXPECTED RESULT
Text would normally be pasted, in this case it is not

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma:  CachyOS Linux
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0 
Qt Version: 6.10.0

ADDITIONAL INFORMATION
Comment 1 jcyphers 2025-10-25 02:04:17 UTC
Sorry for the failure to delete the instructional text at the top of the description, got distracted and failed to delete it before submitting.
Comment 2 Kam 2025-10-26 19:44:10 UTC
I've got the same issue. I can copy stuff from wine/proton and paste it into native apps. Copying from native and pasting into wine/proton doesn't work.
Comment 3 Nicholas Page 2025-10-26 23:12:25 UTC
I think I am having a similar issue! I can't paste from my KDE guest to my VirtualBox host. I can only paste from guest to host.
Comment 4 Tom Dzmelyk 2025-10-27 03:07:08 UTC
Tried some of the usual suspect from clipboard tomfoolery like toggling Middle Click paste and sync Selection and Clipboard but neither had any effect. 

I can paste into X11 applications like Steam itself for example but cannot paste into Wine/Proton applications.
Comment 5 jcyphers 2025-10-27 04:01:27 UTC
Can verify that I can copy text from the wine/proton application and it goes to the clipboard.  Just cannot get anything from the clipboard into the wine/proton applications.
Comment 6 DeadlineV 2025-10-27 14:01:33 UTC
Same on CachyOS. Endeavour forum suggested workaround:
yay -S wl-clipboard clipboard-sync
systemctl --user enable --now clipboard-sync
Comment 7 Kam 2025-10-27 14:57:29 UTC
(In reply to DeadlineV from comment #6)
> Same on CachyOS. Endeavour forum suggested workaround:
> yay -S wl-clipboard clipboard-sync
> systemctl --user enable --now clipboard-sync

I've seen that 'workaround' but unfortunately it doesn't work.
It's been pulled from Manjaro forums and the issue was with Plasma 5. I can confirm that the clipboard worked before the 6.5 update.
Comment 8 Fushan Wen 2025-10-27 15:06:20 UTC
Disabling klipper doesn't fix it so not related to klipper.
Comment 9 Levi 2025-10-27 18:06:10 UTC
Experiencing the same issue, when trying to copy into wine nothing is happening
Comment 10 Vlad Zahorodnii 2025-10-27 18:29:58 UTC
(In reply to Fushan Wen from comment #8)
> Disabling klipper doesn't fix it so not related to klipper.

It's probably related to some fixes that we made to address a bug where copy pasting from X apps to Wayland apps doesn't work. I have some rough idea where things could break.

Does this happen with any wine app?
Comment 11 Kam 2025-10-27 18:48:52 UTC
(In reply to Vlad Zahorodnii from comment #10)
> (In reply to Fushan Wen from comment #8)
> > Disabling klipper doesn't fix it so not related to klipper.
> 
> It's probably related to some fixes that we made to address a bug where copy
> pasting from X apps to Wayland apps doesn't work. I have some rough idea
> where things could break.
> 
> Does this happen with any wine app?

I can confirm that it's all wine/proton apps I've tried.
I've tried games mainly (cs 1.6, Dragon Ball Ultimate Online, Turtle WoW)
Also happens with apps (Rockstar Launcher, Ubisoft Connect, notepad).
Comment 12 jcyphers 2025-10-27 19:24:31 UTC
(In reply to Vlad Zahorodnii from comment #10)
> (In reply to Fushan Wen from comment #8)
> > Disabling klipper doesn't fix it so not related to klipper.
> 
> It's probably related to some fixes that we made to address a bug where copy
> pasting from X apps to Wayland apps doesn't work. I have some rough idea
> where things could break.
> 
> Does this happen with any wine app?

I can confirm that it is happening with anything I have running Proton 10+, but I was able to paste into the Affinity Apps running a legacy version of Elemental Warrior.
Comment 13 Vlad Zahorodnii 2025-10-27 21:36:55 UTC
Okay, got it. Thanks.
Comment 14 Rose 2025-10-28 02:00:18 UTC
Can replicate this issue on both my PC and another PC (both almost exactly the same builds, one with AMD GPU and the other nVidia, both with CachyOS). Here are the tests we've tried:

𐄂 = did not paste
✓= pasted correctly

Via Steam (Runtime) and CachyOS Proton 10 (Steam Runtime)
𐄂 Kate, Librewolf → Elite Dangerous
𐄂 Kate, Konsole → Enshrouded
𐄂 Clipboard, Konsole, Kate → Teddy's Haven
✓ Teddy's Haven ⇄ Enshrouded
✓ All of the above Steam games → Kate, Konsole, Librewolf

Via Steam (Native) and Proton 8.0-5
𐄂 Librewolf → Elite Dangerous

Via Steam and Proton GE 10.21
𐄂 Librewolf, Alacritty. Wezterm, Chromium → Elite Dangerous
✓ Elite Dangerous → Elite Dangerous

Via Wine 10.17-1.1
✓ Microsoft Notepad → Librewolf, Kate, Wezterm
𐄂 Wezterm, Librewolf → Microsoft Notepad

Via Steam Proton and Wine
✓ Enshrouded, Elite Dangerous ⇄ Microsoft Notepad

Interestingly we can paste into Steam games (tried Teddy's Haven and Enshrouded) but only once and only the current copy after we've first started the game. Steps to reproduce this are:
- Copy text (in this test it was from Konsole)
- Start game (Steam is already running)
- Edit an in-game text field and paste.

As soon as we alt-tab and copy something else, we can no longer paste anything. This 'trick' did not work however if we tried it directly through Wine and Microsoft Notepad, only if we copied and then started a Steam game.

So we can copy paste within Wine or Proton apps (doesn't matter what combo of Proton/Proton or Wine/Proton) all fine. We can copy from Wine/Proton to native apps. We can copy from native apps to Proton apps ONCE after the app is first run - thereafter no more pasting will work. We cannot copy from native apps to Proton after the app has already been started. We cannot copy from native apps to Wine apps at all.
Comment 15 Bug Janitor Service 2025-10-28 08:28:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8317
Comment 16 Vlad Zahorodnii 2025-10-28 12:23:27 UTC
Git commit bb6e9d3ec1f637d9af00b7f47962c84eb18b817b by Vlad Zahorodnii.
Committed on 28/10/2025 at 11:45.
Pushed by vladz into branch 'master'.

xwayland: Update clipboard when active window changes

Amends 947d2c5ad0746d807b04f6bb382e1d4ddb1b7f29.

The clipboard was decoupled from active window changes in order to fix
copy-pasting not working from X to Wayland clients.

With that approach, if a wayland client sets new clipboard contents, kwin
will update the CLIPBOARD selection immediately but also expect that
clients won't access the selection until they are focused.

WINE breaks that assumption. It wants to access the selection as soon as
SelectionNotify events arrive, it doesn't access it later when user
presses Ctrl-V in a focused window.

This change restores focus tracking bits but with a few twists: first,
xcb_selection_set_owner() to unset the owner is no longer nuclear, i.e.
kwin won't overwrite selection owner if somebody already claimed it;
second, the X source won't be nuked when we unset the Wayland proxy
source object.

M  +36   -3    src/xwayland/clipboard.cpp
M  +5    -5    src/xwayland/clipboard.h
M  +34   -3    src/xwayland/primary.cpp
M  +5    -5    src/xwayland/primary.h
M  +20   -8    src/xwayland/selection.cpp
M  +1    -0    src/xwayland/selection.h

https://invent.kde.org/plasma/kwin/-/commit/bb6e9d3ec1f637d9af00b7f47962c84eb18b817b
Comment 17 jcyphers 2025-10-28 16:24:30 UTC
You sir are awesome, thank you for looking into this issue for us.  Will be looking for the updated package.
Comment 18 Vlad Zahorodnii 2025-10-28 17:04:42 UTC
Git commit d4a8ef29e1f6ef7a0690900a7a335d6da1eb244b by Vlad Zahorodnii.
Committed on 28/10/2025 at 14:25.
Pushed by vladz into branch 'Plasma/6.5'.

xwayland: Update clipboard when active window changes

Amends 947d2c5ad0746d807b04f6bb382e1d4ddb1b7f29.

The clipboard was decoupled from active window changes in order to fix
copy-pasting not working from X to Wayland clients.

With that approach, if a wayland client sets new clipboard contents, kwin
will update the CLIPBOARD selection immediately but also expect that
clients won't access the selection until they are focused.

WINE breaks that assumption. It wants to access the selection as soon as
SelectionNotify events arrive, it doesn't access it later when user
presses Ctrl-V in a focused window.

This change restores focus tracking bits but with a few twists: first,
xcb_selection_set_owner() to unset the owner is no longer nuclear, i.e.
kwin won't overwrite selection owner if somebody already claimed it;
second, the X source won't be nuked when we unset the Wayland proxy
source object.
(cherry picked from commit bb6e9d3ec1f637d9af00b7f47962c84eb18b817b)

M  +36   -3    src/xwayland/clipboard.cpp
M  +5    -5    src/xwayland/clipboard.h
M  +34   -3    src/xwayland/primary.cpp
M  +5    -5    src/xwayland/primary.h
M  +20   -8    src/xwayland/selection.cpp
M  +1    -0    src/xwayland/selection.h

https://invent.kde.org/plasma/kwin/-/commit/d4a8ef29e1f6ef7a0690900a7a335d6da1eb244b
Comment 19 David Edmundson 2025-10-29 16:09:44 UTC
*** Bug 511325 has been marked as a duplicate of this bug. ***
Comment 20 Harald Sitter 2025-10-31 11:23:47 UTC
*** Bug 511375 has been marked as a duplicate of this bug. ***
Comment 21 strudelkuchen 2025-10-31 16:49:24 UTC
That fixed my issue in Steam games. Thanks Vlad!
Comment 22 jcyphers 2025-11-13 17:51:40 UTC
The fixes applied in 6.5.2 corrected the issue perfectly.  I am marking this as resolved!  

Thanks to the KDE Team!