Bug 509689 - Copied screenshot is not copied
Summary: Copied screenshot is not copied
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: 6.4.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-19 16:29 UTC by German Pulido
Modified: 2025-12-15 10:20 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description German Pulido 2025-09-19 16:29:38 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

I take a screenshot (rectangular selection, if it matters) but it is not copied to the clipboard. The option "After taking a screenshot" is set to "Copy image to clipboard". I am using PNG format for all my screenshots. If I manually click the button to copy the screenshot, then it is copied fine and I can paste it whenever I want. My system uses Wayland, if it matters for anything.

STEPS TO REPRODUCE
1. Take a screenshot (rectanglar selection exhibits the bug)
2. Try to paste it anywhere
3. It does not work
4. Click the "copy" button on the main Spectacle interface
5. Image is copied correctly and it can be pasted

OBSERVED RESULT
Image is not copied to the clipboard immediately after taking it

EXPECTED RESULT
Image is copied to the clipboard immediately after taking it (No need to click copy button)

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

ADDITIONAL INFORMATION
Using Wayland
Comment 1 Nate Graham 2025-09-19 17:58:58 UTC
Have you disabled the clipboard widget, by any chance?
Comment 2 German Pulido 2025-09-19 18:25:19 UTC
(In reply to Nate Graham from comment #1)
> Have you disabled the clipboard widget, by any chance?

Hi, thanks for replying. I don't think it's disabled, since I have a little clipboard icon next to the clock in the desktop and when I click on it I see text and images that I have previously copied. Do I have to disable it?
Comment 3 Bug Janitor Service 2025-10-14 18:11:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/spectacle/-/merge_requests/481
Comment 4 Bug Janitor Service 2025-12-11 10:42:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/191
Comment 5 David Edmundson 2025-12-15 10:20:59 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 509065, 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