Window shadows have a visible gap on the top and left sides between the shadow and the window, as well as noticeable visible oddities on the corners.
Created attachment 153871 [details] screenshot of window with described bug
Bisected to 8a91ef78d5069603369600ca1fc715f782d917fb.
Also, when maximised, the top border of windows flickers for a long while before becoming opaque. (No video because hardware can't handle screen capture at 4k at high enough FPS to illustrate the flickering)
Seems the outline coordinates do not scale well with HiDPI settings. Unfortunately I do not have HiDPI monitor, so I don't know if I can work on this. And flickering sounds like it's drawing shadows very rapidly for some reason.
Can confirm, I have a HiDPI monitor with 175% scaling on Wayland and the outline doesn't look right.
Does the bug happen when using 200% scaling? Or does it only happen with 125%, 150% and 175%?
Created attachment 153948 [details] HiDPI 175% scaling Wayland From what I can tell, with 200% scaling, the artifact is less significant but can still be observed. Looking at the border of a window from the inside to the outside, it first gets brighter, then darker and finally brighter again. Added some screenshots.
Created attachment 153949 [details] HiDPI 175% scaling Wayland
Created attachment 153950 [details] HiDPI 200% scaling Wayland
> Unfortunately I do not have HiDPI monitor, You can still test scaling without needing a High DPI monitor; just set the systemwide scale to 125% and live with everything being a bit bigger than normal while you investigate the bug. :)
(In reply to Nate Graham from comment #10) > > Unfortunately I do not have HiDPI monitor, > > You can still test scaling without needing a High DPI monitor; just set the > systemwide scale to 125% and live with everything being a bit bigger than > normal while you investigate the bug. :) Oh, good to know! I will see if I can fix this issue or if it's somewhere else: I was thinking are shadows drawn wrong with higher scaling but it never showed up because they're less "in your face?"
I am unable to replicate the issue when using the KDE Neon Unstable inside VM. Could this have been a bug in somewhere else?
Created attachment 154266 [details] KDE Neon Unstable scaling 200% x11 Added an image of the scaling in VM. As you can see the border looks normal.
.. Oops, my bad. I had X11 and not Wayland. :P In Wayland I can see the bug.
I managed to find the cause of the bug: https://invent.kde.org/plasma/breeze/-/blob/master/kdecoration/breezedecoration.cpp#L831 The QMarginsF is not being scaled properly by Wayland/Qt, or its the pen size itself. Check this part for possible causes why its happening: https://doc.qt.io/qt-5/qrectf.html#rendering Basically the width of the pen changes -> its drawn differently on the rectangle, depending if the width is even or odd value. If the pen could be changed to always draw outside of the rectangle, no matter what width, this might work better. That, or make scale the value so that its always odd, no matter what the scaling setting is.
I think I have fixed it for 200% scaling, but fractional scaling has issues due to rendering to nearest integer size. I'm afraid there is nothing else I can do until Plasma 6 / Qt 6. At least, I have no idea what to do. :( Here's the commit I've done to fix the 200% scaling if you wish to give it a try however. I can't see the issue as prominent anymore, but I do not know for 100% if it's fixed. https://invent.kde.org/akselmo/breeze/-/commit/825d1e80863b96b10d36fa939bcbceb295ac126e
Could you please check if this works on the newer builds of KWin that have Wayland Fractional Scaling implemented? I think I see less artifacts now, however I do believe I may have to change the shadow rectangles (which the outlines use) from using integers (QRect) to using floats (QRectF). This requires modifying KDecoration2.
Created attachment 155000 [details] Different scalings I tested with a fresh master build and then with the patch applied. Unfortunately it looks like problem persists in all cases.
*** Bug 468020 has been marked as a duplicate of this bug. ***
Can't reproduce on Plasma 6 anymore after this merge request: https://invent.kde.org/plasma/kwin/-/merge_requests/4793 Tested on 125% and 150% scaling.
I can confirm that the issue is now fixed for me as well!
Can the fix be backported?
In addition to the fact that no more Plasma 5 bugfix releases are planned, KWin's code has changed enough between Plasma 5 and 6 as to make a backport laborious and risky. So I suspect not.
Any way to, at least, hide it? It is of no practical use, so hiding it is perfectly acceptable. At least users will not remain with a broken feature for many other months.
There's a setting to hide it in Plasma 6.
Hiding it would be useful for the systems where it is broken. Would it be possible to hide the broken feature for Plasma5, which is still what users will use for several months? For instance, would it be possible to simply not draw it when scaling != 1? I do not think users will complain for a missing broken feature.
At this point no further Plasma 5 releases are planned, so I don't think so, sorry.
*** Bug 479866 has been marked as a duplicate of this bug. ***
Unfortunately I can still reproduce the issue at 112%, 125%, and 150% scale on a 1080p screen. Interestingly, I cannot reproduce it using 1225% or 250% scale factors on a 4k screen.
Git commit 6171b3feeabb0860f5b19980e4a302a5a80ee64c by Akseli Lahtinen. Committed on 24/01/2024 at 22:55. Pushed by akselmo into branch 'master'. Move outline drawing to Decoration::paint Instead of drawing window outline in the shadow drawcall, draw it on top of border instead. This helps keeping the outline size in sync with the window size and has less glitches. Also moved shadow a tiny bit under the window, so it wont snap from next of the window when using fractional scaling. Should at the very least alleviate the issues, if not fix them all. M +54 -59 kdecoration/breezedecoration.cpp M +7 -1 kdecoration/breezedecoration.h https://invent.kde.org/plasma/breeze/-/commit/6171b3feeabb0860f5b19980e4a302a5a80ee64c
A possibly relevant merge request was started @ https://invent.kde.org/plasma/breeze/-/merge_requests/412
Git commit ff0635d876a00754d3ce421a40a91ae7c24b0738 by Akseli Lahtinen. Committed on 24/01/2024 at 23:16. Pushed by akselmo into branch 'Plasma/6.0'. Move outline drawing to Decoration::paint Instead of drawing window outline in the shadow drawcall, draw it on top of border instead. This helps keeping the outline size in sync with the window size and has less glitches. Also moved shadow a tiny bit under the window, so it wont snap from next of the window when using fractional scaling. Should at the very least alleviate the issues, if not fix them all. (cherry picked from commit 6171b3feeabb0860f5b19980e4a302a5a80ee64c) M +54 -59 kdecoration/breezedecoration.cpp M +7 -1 kdecoration/breezedecoration.h https://invent.kde.org/plasma/breeze/-/commit/ff0635d876a00754d3ce421a40a91ae7c24b0738
Fixed for Plasma 6.0.1 with the commits in https://invent.kde.org/plasma/kdecoration/-/merge_requests/56 and https://invent.kde.org/plasma/breeze/-/merge_requests/416, but only for Breeze. In Plasma 6.1, we're going to try to come up with something more comprehensive that works for everything.