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: RESOLVED FIXED    
Severity: major CC: 4wy78uwh, contact, derivativeoflog7, EpicTux123, 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.3
Sentry Crash Report:
Attachments: Screenshot from Spectacle, showing correctly-sized image, but with shadow-sized padding around the window being captured
A Screenshot Of Shadows Remaining For A GTK 3-Based GUI With Spectacle 6.5.2
A Low-Resolution, Active-Window Screenshot, Without Borders, From spectacle-6.5.3-1.fc43

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?
Comment 9 derivativeoflog7 2025-11-10 17:21:14 UTC
Since nobody mentioned this - it also happens using the CLI
Comment 10 Roke Julian Lockhart Beedell 2025-11-10 17:25:35 UTC
(In reply to derivativeoflog7 from comment #9)

> Since nobody mentioned this - it also happens using the CLI

I've detailed that at https://bugs.kde.org/show_bug.cgi?id=511477#c0.
Comment 11 Bug Janitor Service 2025-11-13 07:56:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8427
Comment 12 Vlad Zahorodnii 2025-11-13 12:56:17 UTC
Git commit 1eaa8145daf37c18f51047320c484192dff48eb6 by Vlad Zahorodnii.
Committed on 13/11/2025 at 12:07.
Pushed by vladz into branch 'master'.

plugins/screenshot: Fix viewport rect for window screenshots

The viewport rect varies depending on provided screenshot options.

M  +1    -1    src/plugins/screenshot/screenshot.cpp

https://invent.kde.org/plasma/kwin/-/commit/1eaa8145daf37c18f51047320c484192dff48eb6
Comment 13 Vlad Zahorodnii 2025-11-13 13:40:59 UTC
Git commit ec852ba9dde9f3244da1d1b00d0ad5338d9287e2 by Vlad Zahorodnii.
Committed on 13/11/2025 at 12:58.
Pushed by vladz into branch 'Plasma/6.5'.

plugins/screenshot: Fix viewport rect for window screenshots

The viewport rect varies depending on provided screenshot options.


(cherry picked from commit 1eaa8145daf37c18f51047320c484192dff48eb6)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +1    -1    src/plugins/screenshot/screenshot.cpp

https://invent.kde.org/plasma/kwin/-/commit/ec852ba9dde9f3244da1d1b00d0ad5338d9287e2
Comment 14 Roke Julian Lockhart Beedell 2025-11-18 22:27:35 UTC
Created attachment 186936 [details]
A Screenshot Of Shadows Remaining For A GTK 3-Based GUI With Spectacle 6.5.2

(In reply to Bug Janitor Service from comment #2)

> A possibly relevant merge request was started @
> https://invent.kde.org/plasma/kwin/-/merge_requests/8335

Shadows remain for at least GTK 3-based software, of which `gnome-abrt-1.4.3-8.fc43` is an example, per https://discussion.fedoraproject.org/t/why-has-abrt-silently-ceased-to-enumerate-coredumpctls-entries/172903/2#p-456902-gnome-abrt-2. I'm using:

> ~~~
> Name        : spectacle
> Epoch       : 1
> Version     : 6.5.2
> Release     : 1.fc43
> Architecture: x86_64
> Install Date: Fri 07 Nov 2025 13:23:39 GMT
> Size        : 6857564
> Signature   :
>               RSA/SHA256, Thu 06 Nov 2025 15:08:03 GMT, Key ID 829b606631645531
> Source RPM  : spectacle-6.5.2-1.fc43.src.rpm
> Build Date  : Thu 06 Nov 2025 11:45:10 GMT
> Build Host  : buildvm-x86-15.rdu3.fedoraproject.org
> Packager    : Fedora Project
> Vendor      : Fedora Project
> URL         : https://www.kde.org/applications/graphics/spectacle/
> Bug URL     : https://bugz.fedoraproject.org/spectacle
> ~~~

I was under the impression that although the resolution downsampling had been resolved in 6.5.3, the lack of shadows had been resolved in 6.5.2. Is that correct? It had certainly been resolved for all Qt applications, for me, with 6.5.2.

I dare say that these two problems being in one report is a little confusing to track.
Comment 15 EpicTux123 2025-11-20 18:56:25 UTC
*** Bug 511484 has been marked as a duplicate of this bug. ***
Comment 16 Roke Julian Lockhart Beedell 2025-11-23 14:22:16 UTC
Created attachment 187092 [details]
A Low-Resolution, Active-Window Screenshot, Without Borders, From spectacle-6.5.3-1.fc43

> I was under the impression that although the resolution downsampling had
> been resolved in 6.5.3, the lack of shadows had been resolved in 6.5.2. Is
> that correct? It had certainly been resolved for all Qt applications, for
> me, with 6.5.2.
> 
> I dare say that these two problems being in one report is a little confusing
> to track.

Not even the downsampling has been remediated in 6.5.3, and it still fails to capture Breeze's borders. Should this be reopened?
Comment 17 Roke Julian Lockhart Beedell 2025-11-23 16:46:38 UTC
Comment on attachment 187092 [details]
A Low-Resolution, Active-Window Screenshot, Without Borders, From spectacle-6.5.3-1.fc43

Ignore that: when viewed at 100% scale, it's not low-resolution. All that remains is https://bugs.kde.org/show_bug.cgi?id=511171#c7.