Bug 509065

Summary: Screenshots fail to copy to clipboard
Product: [Applications] Spectacle Reporter: Sollace <sollacea>
Component: GeneralAssignee: Noah Davis <noahadvs>
Status: RESOLVED FIXED    
Severity: normal CC: amr.nabeel, famine_cavalier538, kde, kdedev, nate, officialdeltadizzy, palapapa93, pallaswept, scaine
Priority: NOR    
Version First Reported In: 6.3.6   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.22
Sentry Crash Report:

Description Sollace 2025-09-03 11:33:06 UTC
SUMMARY

Occasionally when taking a screenshot in Spectacle will fail to copy the image to the clipboard. I see it appear in clipboard history but I'm unable to paste it anywhere with Ctrl+V. Other programs that read from the clipboard (GiMP) also cannot see the image data, and any attempt to re-copy it by clicking the entry in the clipboard history fails.

STEPS TO REPRODUCE
1. Launch spectacle and take a screenshot of any region of your screen
2. Attempt to paste into a Dolphin window (Crl+V), or in GiMP press Ctrl+Shift+V
3. Repeat until the error occurs

OBSERVED RESULT
Both Dolphin and GiMP report that the clipboard is empty.

EXPECTED RESULT
Dolphin should display a prompt to name the file and GiMP should load and display the image.

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

ADDITIONAL INFORMATION
Comment 1 Sollace 2025-09-03 11:35:13 UTC
Since the attachment file size limit is only 4MB, here is a video of the bug uploaded to youtube:
https://www.youtube.com/watch?v=3bXx0_t1K-c
Comment 2 Bug Janitor Service 2025-09-06 14:02:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/182
Comment 3 Bug Janitor Service 2025-10-14 18:11:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/spectacle/-/merge_requests/481
Comment 4 Emily B 2025-11-11 20:08:22 UTC
I also have this issue, and it is so frequent that I have been able to paste a screenshot only a handful of times total over the past 2-3 days (mainly in the form of trying to post screenshots to Discord). The 3rd-party Flameshot software does not have the issue, but I prefer Spectacle's UX when the bug is not occurring.

Software Versions:
Fedora 42 KDE Edition
Plasma 6.5.1
Spectacle 6.5.1
Frameworks 6.19.0
Qt 6.9.3
Comment 5 scaine 2025-11-13 14:01:01 UTC
*** Bug 511736 has been marked as a duplicate of this bug. ***
Comment 6 scaine 2025-11-13 14:05:32 UTC
I'm not completely certain, but this might be a duplicate of an earlier closed bug, which has now been re-opened: 507792
Comment 7 TraceyC 2025-11-13 18:00:31 UTC
*** Bug 512029 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2025-12-08 23:44:50 UTC
I have seen this in the recent past: When I have Spectacle set up automatically copy to the clipboard, the screenshot would fail to paste into any app. When I manually clicked "Copy to clipboard" then the thing that's added to the clipboard will paste into apps.

However I can't reproduce the issue on current git master of Spectacle and KWin right now.
Comment 9 Nate Graham 2025-12-09 21:57:41 UTC
I can't reproduce the issue depicted in the video with today's git master, but it looks like Spectacle's settings (and also system notifications?) have been customized. Sollace, can you describe the specific settings you're using?
Comment 10 pallaswept 2025-12-09 22:56:27 UTC
Is this a dupe of https://bugs.kde.org/show_bug.cgi?id=480448
Comment 11 Bug Janitor Service 2025-12-11 10:42:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/191
Comment 12 David Edmundson 2025-12-15 10:20:51 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 502831, bug 505281, bug 506467, bug 507792, 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