Bug 487902

Summary: corruption in bottom part of non-floating panel under Wayland with fractional scaling when floating would occur
Product: [Plasma] kwin Reporter: Justin Wayland <justintwayland>
Component: platform-wayland-nestedAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: kde
Priority: NOR    
Version First Reported In: 6.0.5   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Shows the center of a panel. Corrupted pixels can be seen beneath.
Shows corruption at the right of the panel in addition to the center. You have to zoom in on the right to see it.

Description Justin Wayland 2024-06-01 22:34:14 UTC
Created attachment 170055 [details]
Shows the center of a panel. Corrupted pixels can be seen beneath.

Different from bug #482987 because it is less reliable in showing up and disappears when using floating panels or using a maximized window

SUMMARY
Non-floating panels sometimes have their bottom row of pixels corrupted when a maximized window does not exist. This in general seems to overlap with when KDE would decide to make the panel float if floating were set.

STEPS TO REPRODUCE
1. Log in to KDE. Make sure the bottom panel is **not** a floating panel.
2. Open up Firefox. Maximize the window.
3. Repeatedly minimize and maximize the window.

OBSERVED RESULT
A row of corrupted pixels sometimes shows up at the bottom of the panel.

EXPECTED RESULT
Pixels should never be corrupted by repeated minimizing and maximizing.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.9.1-1-default
(available in About System)
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
This only occurs when fractional scaling is used.
This only occurs under Wayland; X11 has so far had no problems with this.
This can be worked around by setting the panel to be floating.
Given that this occurs only when floating would occur, this may be related to floating panel functionality being wrongly called on non-floating panels.

If further images are needed for added context, let me know! It's pretty easy to reproduce this bug and takes less than a minute to trigger.

HARDWARE INFO
Processors: 16 × AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Memory: 14.9 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Framework
Product Name: Laptop 16 (AMD Ryzen 7040 Series)
System Version: A7
Comment 1 Justin Wayland 2024-06-01 22:46:21 UTC
Turns out there's more to this than it seems!

I forgot to mention in the above comment that I had my icons only task manager centered in the panel. When I removed the spacers centering it, I haven't managed to reproduce the bug since.  In addition, adding the spacers back in hasn't allowed me to reproduce it either. You seem to specifically have to login with the two spacers to trigger the issue.

I'll continue experimenting to see what is needed to trigger this bug.
Comment 2 Justin Wayland 2024-06-01 22:48:37 UTC
(In reply to Justin Wayland from comment #1)
> Turns out there's more to this than it seems!
> 
> I forgot to mention in the above comment that I had my icons only task
> manager centered in the panel. When I removed the spacers centering it, I
> haven't managed to reproduce the bug since.  In addition, adding the spacers
> back in hasn't allowed me to reproduce it either. You seem to specifically
> have to login with the two spacers to trigger the issue.
> 
> I'll continue experimenting to see what is needed to trigger this bug.

Never mind, it just triggered even without the spacers.
Comment 3 Justin Wayland 2024-06-01 23:11:04 UTC
Created attachment 170057 [details]
Shows corruption at the right of the panel in addition to the center. You have to zoom in on the right to see it.

This shows something critical. There is a corrupted pixel on the right, which you have to zoom in to see.  This makes it even more likely that this bug is the result of a race condition in the floating windows functionality, given that it doesn't always happen and only occurs when a floating panel would start floating.
Comment 4 David Edmundson 2024-06-03 05:11:39 UTC
This should be fixed in 6.1, please reopen if an issue persists.

In the meantime a subtly different scaling factor should work round your issue