Bug 496928

Summary: Shadow of a floating Plasma panel is drawn with a gap on X11 at any global scale other than 100%
Product: [Plasma] plasmashell Reporter: ratijas <me>
Component: PanelAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kdedev, niccolo.venerandi
Priority: NOR    
Version First Reported In: 6.2.4   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: plasma panel shadow gap

Description ratijas 2024-12-02 11:24:07 UTC
Created attachment 176286 [details]
plasma panel shadow gap

SUMMARY
The higher the global scale is == the bigger the gap between actual edges of a floating panel and its shadow. It does not matter if the scaling factor is integer or fractional.

STEPS TO REPRODUCE
1. Add a panel, make it floating.
2. Go to Display Configuration, set Global scale to something other than 100%.
3. Restart plasma (or log out and log back in).

OBSERVED RESULT
There is a shadow around the panel, but it floats at some offset from the actual edges, forming a bright and annoying gap. The shadow is not drawn in QtQuick scene (as proven by inspecting the panel's scene via GammaRay), and is probably drawn elsewhere at the compositor level.

EXPECTED RESULT
Shadow should fit the panel.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.12.1-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 9 7940HS w/ Radeon 780M Graphics
Graphics Processor: AMD Radeon 780M
Comment 1 TraceyC 2024-12-12 19:16:25 UTC
I was able to confirm this behavior
I tested with a floating panel and set the X11 display to 106.25% and then restarted plasma
It's easiest to see with a plain white desktop
Comment 2 Bug Janitor Service 2025-02-07 15:17:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5173
Comment 3 Niccolò Venerandi 2025-02-10 13:35:41 UTC
Git commit 708dca00f5706049078fedd4f1f5cd05482f78d8 by Niccolò Venerandi.
Committed on 10/02/2025 at 13:35.
Pushed by niccolove into branch 'master'.

Multiply floating panel shadow margin by scale factor on X11

The padding for svg hints on X11 is does not account
for scale factors, so we multiply it on the panel shadows
side.

M  +5    -0    shell/panelshadows.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/708dca00f5706049078fedd4f1f5cd05482f78d8
Comment 4 Niccolò Venerandi 2025-02-10 13:35:55 UTC
Git commit 25f00376ef0f86e725165b2cf396795ba217d2c8 by Niccolò Venerandi.
Committed on 10/02/2025 at 13:35.
Pushed by niccolove into branch 'Plasma/6.3'.

Multiply floating panel shadow margin by scale factor on X11

The padding for svg hints on X11 is does not account
for scale factors, so we multiply it on the panel shadows
side.


(cherry picked from commit 708dca00f5706049078fedd4f1f5cd05482f78d8)

Co-authored-by: Niccolò Venerandi <niccolo@venerandi.com>

M  +5    -0    shell/panelshadows.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/25f00376ef0f86e725165b2cf396795ba217d2c8