Bug 502831 - Closing Meta+V popup without selecting anything causes the current copied data from Klipper to be lost
Summary: Closing Meta+V popup without selecting anything causes the current copied dat...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (other bugs)
Version First Reported In: 6.3.4
Platform: Manjaro Linux
: HI major
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression, wayland-only
: 443265 498341 512889 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-04-15 11:16 UTC by medin
Modified: 2025-12-15 10:20 UTC (History)
16 users (show)

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


Attachments
Issue on Plasma 6.3.91 (6.4 Beta 2) (1.41 MB, video/x-matroska)
2025-05-29 21:12 UTC, Fernando M. Muniz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description medin 2025-04-15 11:16:51 UTC
Steps:

1. Copy 3 different random texts for testing, for now you should see 3 textual items saved in Klipper widget,
2. Open Kate editor (or any app like Firefox)
3. Press Meta+V and select 2nd item
4. Press Ctrl+V to paste it into Kate
5. Press Meta+V, then without selecting any item from Klipper, click outside the floating window to cancel the operation
6. Press Ctrl+V into Kate

Observed result:
Nothing is pasted into Kate

Wanted result:
First item (previously second one) should be copied into Kate



7. Press Meta+V then re-select the first item
8. Press Ctrl+V inside Kate

Observed result:
Nothing is copied into Kate

Wanted result:
The first item should be copied into Kate

Note: If I select any item different from the first one, Ctrl+V will paste it into Kate, but after cancelling Meta+V  window the problem reappears again.


Operating System: Manjaro Linux 
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.9.0
Kernel Version: 6.14.2-1-MANJARO (64-bit)
Graphics Platform: Wayland
Comment 1 Fushan Wen 2025-04-15 11:18:27 UTC
Can reproduce
Comment 2 Fushan Wen 2025-04-17 03:22:14 UTC
*** Bug 498341 has been marked as a duplicate of this bug. ***
Comment 3 Bug Janitor Service 2025-04-18 12:52:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5398
Comment 4 Fushan Wen 2025-04-18 13:13:46 UTC
*** Bug 502444 has been marked as a duplicate of this bug. ***
Comment 5 Fushan Wen 2025-04-18 13:14:44 UTC
*** Bug 443265 has been marked as a duplicate of this bug. ***
Comment 6 medin 2025-04-25 22:14:50 UTC
Another scenario which needs to be repeated several times to result the same behavior:

1. Meta+V then select an item different from the first one
2. Paste it into Kate
3. Meta+V then select the first item (the same one currently copied)
4. Paste it into Kate

5. Repeat steps from 1 to 4 until you get nothing when you paste the copied text.
Comment 7 Marco Martin 2025-05-20 12:07:36 UTC
I can reproduce, and it seems Wayland specific
Comment 8 Marco Martin 2025-05-20 12:08:44 UTC
note that the items are not lost from the clipboard history, they are just lost from the current clipboard, ctrl+V doesn't work anymore, but the history is intact
Comment 9 Bug Janitor Service 2025-05-27 12:50:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5526
Comment 10 Fernando M. Muniz 2025-05-29 21:12:09 UTC
Created attachment 181884 [details]
Issue on Plasma 6.3.91 (6.4 Beta 2)

Operating System: Arch Linux 
KDE Plasma Version: 6.3.91
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.7-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-11300H @ 3.10GHz
Memory: 9 GB of RAM (8.1 GB usable)
Graphics Processor 1: NVIDIA GeForce GTX 1650
Graphics Processor 2: Intel® Iris® Xe Graphics
Manufacturer: LENOVO
Product Name: 82MG
System Version: IdeaPad Gaming 3 15IHU6
Comment 11 Fernando M. Muniz 2025-07-09 16:55:43 UTC
Got the bug again in Plasma 6.4.2. Seems like that fix for 6.4 didn't work.
Comment 12 tomashnyk 2025-09-18 11:14:01 UTC
Yeah, the merge request contains a note: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5398#note_1223327

that explains why it did not work.

I can still reproduce it every siungle time it seems. I often use clipboard to check what is in the clipboard without selecting anything, so this is quite severe for me :-(.
Comment 13 Nate Graham 2025-12-09 22:58:37 UTC
*** Bug 512889 has been marked as a duplicate of this bug. ***
Comment 14 Bug Janitor Service 2025-12-11 10:42:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/191
Comment 15 David Edmundson 2025-12-15 10:20:18 UTC
Git commit b71af4e1afcf72b8c9da315dc8d728db70d753c0 by David Edmundson, on behalf of David Redondo.
Committed on 15/12/2025 at 10:16.
Pushed by davidedmundson into branch 'master'.

ksystemclipboard: Dispatch read events in another thread

WaylandClipboard wraps ext_data_control if an application tried to read
the clipboard using QClipboard whilst it owns the data control we would
deadlock.

This was previously being solved by trying to transfer mimedata to the
regular clipboard upon gaining focus. However this never worked
reliably and efforts to fix this only made it more complicated.

To solve the original deadlock all ext_data_control classes now live on
another thread which dispatches events on a separate queue. A recursive
mutex allows the main thread to read mimedata and no wayland events
which change the mimedata process until this is complete.
Related: bug 480448, bug 496029, bug 505281, bug 506467, bug 507792, bug 509065, bug 509689, bug 511736
FIXED-IN: 6.22

M  +116  -14   src/systemclipboard/waylandclipboard.cpp
M  +3    -0    src/systemclipboard/waylandclipboard_p.h

https://invent.kde.org/frameworks/kguiaddons/-/commit/b71af4e1afcf72b8c9da315dc8d728db70d753c0