Bug 492223 - Spectacle screenshots of maximised windows include extra padding when the "Include window shadow" option is enabled
Summary: Spectacle screenshots of maximised windows include extra padding when the "In...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: 6.1.4
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-26 16:33 UTC by Eamonn Rea
Modified: 2025-02-13 16:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eamonn Rea 2024-08-26 16:33:17 UTC
SUMMARY
Since Spectacle 24.08, when taking a screenshot of maximised windows, Spectacle still tries to include the window shadow. As there is no shadow for maximised windows, this creates a border around maximised window screenshots where a shadow would be were the window not maximised, resulting in a larger filesize; with my shadow configuration, windows maximised on a 3840x2160 display now have screenshots with a width of 3900, adding roughly 30 pixels extra on each side. Disabling the "Include window shadow" option fixes this issue. 

This negatively impacts taking screenshots of, for example, game windows, in particular when Spectacle is used to silently take screenshots without the UI. 

This happens with any action that can take a screenshot of a single window, which to my understanding are the "Active Window" and "Window Under Cursor" options.

This was not present in the previous version of Spectacle I used before updating to the new version today with KDE Gear 24.08. I believe the previous version was 24.05.2.

STEPS TO REPRODUCE
1. Maximise a window
2. In Spectacle, ensure the "Include window shadow" option is enabled.
3. Take a screenshot of just this window, using either "Active Window" or "Window Under Cursor"
4. The resulting screenshot has extra padding where the window shadow would be.
5. Disable the "Include window shadow" option.
6. Take a screenshot of a maximised window again, using either "Active Window" or "Window Under Cursor"
7. The resulting screenshot does not have the extra padding like the first screenshot. 

OBSERVED RESULT
Screenshots of maximised windows include extra padding where the window shadow would be, when the "Include window shadow" option is enabled.

EXPECTED RESULT
Screenshots of maximised windows should not include this padding as there are no shadows to capture. This was the behaviour of Spectacle up until 24.08.0, so hopefully it is possible.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.6-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX

ADDITIONAL INFORMATION
I am almost certain this is a regression from 24.05.2, as screenshots that I took yesterday have the correct dimensions, but I am not 100% certain that the previous version I was using was 24.05.2. I am using an up-to-date Arch system, so whatever the last Spectacle release included in stable KDE Gear is the version I was using :-)
Comment 1 Eamonn Rea 2024-08-26 17:10:15 UTC
It seems that not all windows exhibit this behaviour. In fact, from testing, it may be specific to Qt applications (Wayland AND XWayland)

Applications tested that DO exhibit the problem:
- Dolphin (Wayland and XWayland with `QT_QPA_PLATFORM=xcb dolphin`)
- Discover (Wayland)
- Konsole (Wayland)
- ProtonUp-Qt (Wayland and XWayland with `QT_QPA_PLATFORM=xcb python3 -m pupgui2` from source)

Applications tested that DO NOT exhibit the problem:
- Steam (XWayland)
- Firefox (Wayland native)
- Lutris (Wayland native)
Comment 2 Eamonn Rea 2024-09-03 17:25:20 UTC
I am able to reproduce this on my laptop with the same Plasma, Gear, and Frameworks versions. The same parameters apply as well, this does not affect GTK windows like Firefox, but does affect Qt windows like Dolphin.
Comment 3 Eamonn Rea 2024-09-13 20:19:32 UTC
This is still present with the same parameters (as far as I can tell) in Spectacle 24.08.1
Comment 4 Eamonn Rea 2024-10-12 00:28:03 UTC
This is still present in Spectacle 24.08.2 on Plasma 6.2.0.
Comment 5 Eamonn Rea 2025-02-12 22:05:52 UTC
This is still present in Plasma 6.3.0. As far as I can tell, looking  through old screenshots, this has been present throughout Plasma 6.2.0 and up into Plasma 6.3.0.
Comment 6 Noah Davis 2025-02-12 22:48:08 UTC
Moved to KWin since the padded screenshot comes from KWin.