SUMMARY If you take a rectangular screenshot when Spectacle is opened for the first time, the screenshot will consistently be an empty file. What appears in journalctl: ``` Jun 06 19:04:10 hostname plasmashell[2217441]: qrc:/qt/qml/org/kde/plasma/private/clipboard/ImageItemDelegate.qml:26:9: QML Image: Error decoding: file:///home/kostadin/.local/share/klipper/data/da39a3ee5e6b4b0d3255bfef95601890afd80709/da39a3ee5e6b4b0d3255bfef95601890afd80709: Unsupported image format Jun 06 19:04:10 hostname plasmashell[2217441]: qrc:/qt/qml/org/kde/plasma/private/clipboard/ImageItemDelegate.qml:26:9: QML Image: Error decoding: file:///home/kostadin/.local/share/klipper/data/da39a3ee5e6b4b0d3255bfef95601890afd80709/da39a3ee5e6b4b0d3255bfef95601890afd80709: Unsupported image format Jun 06 19:04:10 hostname plasmashell[2217441]: qrc:/qt/qml/org/kde/plasma/private/clipboard/ImageItemDelegate.qml:26:9: QML Image: Error decoding: file:///home/kostadin/.local/share/klipper/data/da39a3ee5e6b4b0d3255bfef95601890afd80709/da39a3ee5e6b4b0d3255bfef95601890afd80709: Unsupported image format ``` A bisect between 6.3.5 and 6.3.91 weirdly led to: https://invent.kde.org/plasma/spectacle/-/commit/606581c1ad90d2dce186ec8437c4bdf20e4039f8 ``` From 606581c1ad90d2dce186ec8437c4bdf20e4039f8 Mon Sep 17 00:00:00 2001 From: Noah Davis <noahadvs@gmail.com> Date: Wed, 28 May 2025 13:40:06 -0400 Subject: [PATCH] Hide capture windows before deleting them when accepting Prevents them from being visible in the background when using Save As. ``` STEPS TO REPRODUCE 1. Make sure Spectacle is not open 2. Launch Spectacle through either Print Screen or the Application Launcher 3. Capture a Rectangular screenshot 4. Copy it 5. Try to paste it into a program like Discord (it will just show image.png with no actual content) OBSERVED RESULT Screenshot is an empty file EXPECTED RESULT The actual screenshot gets copied to the clipboard SOFTWARE/OS VERSIONS Operating System: Gentoo 2.17 KDE Plasma Version: 6.3.91 KDE Frameworks Version: 6.14.0 Qt Version: 6.9.1 Kernel Version: 6.15.1-gentoo (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 7800X3D 8-Core Processor Memory: 32 GiB of RAM (30.9 GiB usable) Graphics Processor: AMD Radeon RX 6800
I can't reproduce the issue with those steps. Are you using any non-default settings in Spectacle? Can you attach your ~/.config/spectaclerc file? Are you using any window rules or other custom compositor settings that could be relevant?
(In reply to Nate Graham from comment #1) > I can't reproduce the issue with those steps. Are you using any non-default > settings in Spectacle? Can you attach your ~/.config/spectaclerc file? Are > you using any window rules or other custom compositor settings that could be > relevant? I actually can't reproduce anymore for some reason. The only setting I've changed in Spectacle is to use the last-capture mode when launching the program. No window rules or anything like that.
Ok, let us know if it happens again.
Can confirm that the bug does occur on my system when manually copying a rectangular region. Seems like it happens randomly though, not only for the first time after logging in. Taking a screenshot again copies it to clipboard properly. Right at the time the screenshot fails to be copied and appears in the clipboard as an empty entry, journalctl says this: ``` plasmashell[1127]: qrc:/qt/qml/org/kde/plasma/private/clipboard/ClipboardItemDelegate.qml:121:32: Unable to assign [undefined] to double ``` My spectaclerc: ``` [Annotations] freehandStrokeColor=15,14,14 freehandStrokeWidth=6 rectangleFillColor=255,255,255 rectangleShadow=false rectangleStrokeColor=0,0,0,0 [General] autoSaveImage=true clipboardGroup=PostScreenshotCopyImage [GuiConfig] captureMode=0 includePointer=true includeShadow=false quitAfterSaveCopyExport=true [ImageSave] lastImageSaveLocation=file:///home/[user]/Pictures/Screenshots/Screenshot_20250622_194609.png translatedScreenshotsFolder=Screenshots [VideoSave] preferredVideoFormat=2 translatedScreencastsFolder=Screencasts ``` Software/OS versions: Operating System: EndeavourOS KDE Plasma Version: 6.4.0 KDE Frameworks Version: 6.15.0 Qt Version: 6.9.1 Kernel Version: 6.15.3-arch1-1 (64-bit) Graphics Platform: Wayland Note: not sure if it's any important, but my setup uses two displays - external monitor connected by HDMI port to a laptop.
Created attachment 182556 [details] Screenshot of settings It seems like the issue disappears when taking a screenshot using the Meta+Shift+Print shortcut (Capture Rectangular Region), instead of launching Spectacle with the Print key (Launch).
I am also being affected by this. Taking a screenshot with Spectacle and then copying it to the clipboard stopped working. The clipboard is empty.
This bug is weird... it does not happen all the time. And I could not figure out when it happens for sure. Right now, I have just logged into my account and took a screenshot and it worked... and then I took a second screenshot, and this one did NOT work. Then the third and fourth worked, and the fifth failed. Go figure. I am using two monitors, maybe this is related?
A possibly relevant merge request was started @ https://invent.kde.org/plasma/spectacle/-/merge_requests/481
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/191
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 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