Bug 464474

Summary: Disabling middle click paste does not affect XWayland applications
Product: [Plasma] kwin Reporter: Oliver Beard <olib141>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: abystus, DianaNites, findanotherplace, meven29, meven, nate, sdar, voidpointertonull+bugskdeorg
Priority: NOR    
Version First Reported In: master   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Oliver Beard 2023-01-18 18:38:51 UTC
SUMMARY
Disabling middle click paste in Workspace Behaviour > General Behaviour is respected by native Wayland applications, but not by applications running under XWayland.

STEPS TO REPRODUCE
1. Launch an XWayland application, and highlight some text.
2. Middle click somewhere to paste it.

OBSERVED RESULT
The highlighted text is pasted.

EXPECTED RESULT
The primary selection buffer is copied to, and then pasted on middle click.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
This might be fixed by preventing filling the primary selection buffer, clearing it on copy, or preventing paste.
Comment 1 Méven Car 2023-01-19 09:00:22 UTC
Is the destination application of the middle is also a XWayland application ?

I don't understand your expected result.
It seems to me the expected result would be "Nothing happens".
Comment 2 Oliver Beard 2023-01-19 09:09:15 UTC
Yep, meant that nothing happens would be the expected result, and yes, both source and destination are XWayland applications.
Comment 3 Pedro V 2023-08-12 12:14:08 UTC
I believe bug 441668 should be reopened and this should be marked as a duplicate of it as the issue wasn't really resolved.

Can confirm this still being an issue with Plasma 5.27.4, just not noticing it often with the progressive moving to Wayland.
Do note thought that as described in the other bug report, this issue can appear to linger around even after a fix due to some programs not wanting to let primary selection go with for example Firefox defaulting to emulating it by default even on Wayland.
Comment 4 Nate Graham 2023-08-14 21:07:56 UTC
The fact that there's a bug in the implementation doesn't mean that the original work wasn't completed. It's appropriate for this to be the bug report for the issue  in question.
Comment 5 Nate Graham 2023-08-14 21:08:16 UTC
Anyway, can reproduce.
Comment 6 Diana 2023-11-30 02:23:12 UTC
Still an issue
Comment 7 Abystus 2025-04-24 21:05:35 UTC
Still appears to be an issue. Can reproduce in:

Plasma Version: 6.3.4
Frameworks Version: 6.13.0
Qt Version: 6.9.0
Comment 8 kmdest 2025-10-30 03:51:14 UTC
Can confirm still, and that XMousePasteBlock works to stop it for this case too, for now.
https://gist.github.com/poyotanp/d3aff65df96d0cf93c78a3e52fedd6fa
Hopefully this gives some respite. I was having a weird lesser bug where this didn't stop the first paste in steam chat windows, but it isn't happening after a restart.

Operating System: CachyOS Linux
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.3-3-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 32 GiB of RAM (31.3 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 3070 Ti
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7C56
System Version: 2.0