Bug 510982

Summary: Under Wayland, screenshots include window shadows, even when the option to do so is disabled
Product: [Applications] Spectacle Reporter: Sean Baggaley <sean>
Component: GeneralAssignee: Noah Davis <noahadvs>
Status: REOPENED ---    
Severity: major CC: 4wy78uwh, contact, f.alexander.wilms, kde, nate, ostroffjh
Priority: HI Keywords: regression
Version First Reported In: 6.5.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.5.2
Sentry Crash Report:
Attachments: Screenshot from Spectacle, showing correctly-sized image, but with shadow-sized padding around the window being captured

Description Sean Baggaley 2025-10-23 22:47:54 UTC
SUMMARY
When taking a screenshot of a window under Wayland, the screenshot includes the window shadow, even when "Include window shadow" is turned off.

STEPS TO REPRODUCE
1. Open Spectacle
2. Under Options, disable "Include window shadow"
3. Take a screenshot using "Active Window" or "Select Window"

OBSERVED RESULT
The screenshot includes the window's shadow.

EXPECTED RESULT
The screenshot shouldn't include the shadow.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20251022
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.4-1-default (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 48 GiB of RAM (47.0 GiB usable)
Graphics Processor: AMD Radeon RX 6700 XT

ADDITIONAL INFORMATION
Seems to be a regression from Plasma 6.4.
Comment 1 Nate Graham 2025-10-24 17:26:52 UTC
Can reproduce.
Comment 2 Bug Janitor Service 2025-10-30 12:20:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8335
Comment 3 Zamundaaa 2025-10-30 14:17:40 UTC
Git commit 2e4bd9a1af707914c8968a88da49c93b2d589680 by Xaver Hugl.
Committed on 30/10/2025 at 13:49.
Pushed by zamundaaa into branch 'master'.

plugins/screenshot: filter out decoration and shadows to match the options

This was accidentally dropped in 7f1ac1136e72b1b404235477dc20014ef3bd522f
Related: bug 511171

M  +16   -2    src/plugins/screenshot/screenshot.cpp

https://invent.kde.org/plasma/kwin/-/commit/2e4bd9a1af707914c8968a88da49c93b2d589680
Comment 4 Zamundaaa 2025-10-30 21:46:24 UTC
Git commit 9c77ac6d3386b453e9f90af5235094dc83c96247 by Xaver Hugl.
Committed on 30/10/2025 at 21:15.
Pushed by zamundaaa into branch 'Plasma/6.5'.

plugins/screenshot: filter out decoration and shadows to match the options

This was accidentally dropped in 7f1ac1136e72b1b404235477dc20014ef3bd522f
Related: bug 511171


(cherry picked from commit 2e4bd9a1af707914c8968a88da49c93b2d589680)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +16   -2    src/plugins/screenshot/screenshot.cpp

https://invent.kde.org/plasma/kwin/-/commit/9c77ac6d3386b453e9f90af5235094dc83c96247
Comment 5 Roke Julian Lockhart Beedell 2025-11-03 21:06:27 UTC
*** Bug 511477 has been marked as a duplicate of this bug. ***
Comment 6 Sean Baggaley 2025-11-07 23:36:31 UTC
Plasma 6.5.2 no longer includes window shadows when the option is disabled, however... the boundary of the shadows is still included in the image, resulting in transparent padding around the window in the screenshot.
Furthermore, the output image is correctly the same size of the window, but with this padding it means the actual window content gets downscaled.
I'll attach an image showing this.
Comment 7 Sean Baggaley 2025-11-07 23:37:25 UTC
Created attachment 186601 [details]
Screenshot from Spectacle, showing correctly-sized image, but with shadow-sized padding around the window being captured
Comment 8 Roke Julian Lockhart Beedell 2025-11-07 23:41:53 UTC
Comment on attachment 186601 [details]
Screenshot from Spectacle, showing correctly-sized image, but with shadow-sized padding around the window being captured

(In reply to Sean Baggaley from comment #6)

> Furthermore, the output image is correctly the same size of the window, but
> with this padding it means the actual window content gets downscaled.
> I'll attach an image showing this.

Ah! Could that be the cause of https://discuss.kde.org/t/blurry-screenshots-using-spectacle/29945/4?u=rokejulianlockhart? IDK whether I should reopen this, or whether we should file a new issue. What do you think?