Bug 464526

Summary: Flickering line above panel for certain heights when using fractional scaling on Wayland with Background Contrast effect turned on
Product: [Plasma] kwin Reporter: Iyán Méndez Veiga <me>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ad.liu.jin, ahiemstra, bill.hmrc, christ.derek, devnulll, goremukin, jd.primary, kdebugs, me, nate, niccolo.venerandi, openmail+kde, poperigby, sthenujan2002, ston.jia, vari4bled
Priority: NOR Keywords: wayland
Version: 5.26.90   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In: 5.27.1
Attachments: Screenshot showing blue line in panel

Description Iyán Méndez Veiga 2023-01-19 22:02:31 UTC
SUMMARY
A blue flickering line is shown above the panel when its height is set to certain sizes. Line seems one or two pixels thick.


STEPS TO REPRODUCE
1. Enter edit mode and set panel height to 38
2. Observe a blue line on top of the bar (see screenshot1.png)
3. Open and maximize any app (e.g. Firefox). Line starts to flicker when scrolling.

OBSERVED RESULT
Small but annoying blue line in the panel. This behavior only happens for certain heights (e.g. 34, 38, etc.). For other heights panel works just fine (e.g. 36, 40, etc.)

EXPECTED RESULT
Any panel height should work without adding artifacts.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 6.1.6-arch1-3 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: LENOVO
Product Name: 20XYCTO1WW
System Version: ThinkPad X1 Yoga Gen 6
Comment 1 Iyán Méndez Veiga 2023-01-19 22:05:51 UTC
Created attachment 155440 [details]
Screenshot showing blue line in panel
Comment 2 Iyán Méndez Veiga 2023-01-19 22:14:46 UTC
Probably this video is more helpful than the text in the bug report ;)
https://drive.switch.ch/index.php/s/0rR2j7871Sf0sG1
Comment 3 Nate Graham 2023-01-23 21:49:52 UTC
What scale factor are you using? And is Firefox using XWayland in that video, or is it in native Wayland mode? If it's using XWayland, can you try again with Firefox forced to native Wayland mode, or another app you know to be native-wayland-compatible (like System Settings or Dolphin, or almost any other KDE app)?
Comment 4 Iyán Méndez Veiga 2023-01-23 21:58:12 UTC
(In reply to Nate Graham from comment #3)
> What scale factor are you using? And is Firefox using XWayland in that
> video, or is it in native Wayland mode? If it's using XWayland, can you try
> again with Firefox forced to native Wayland mode, or another app you know to
> be native-wayland-compatible (like System Settings or Dolphin, or almost any
> other KDE app)?

125% and Firefox is in native Wayland mode.
Comment 5 Nate Graham 2023-01-24 16:42:36 UTC
Cool. Thanks.

Does the problem completely vanish if you use 100% scale?

Are XWayland windows affected, or other native Wayland windows besides Firefox?
Comment 6 Iyán Méndez Veiga 2023-01-26 07:31:25 UTC
(In reply to Nate Graham from comment #5)
> Cool. Thanks.
> 
> Does the problem completely vanish if you use 100% scale?

No, I cannot reproduce with 100% scale.

> Are XWayland windows affected, or other native Wayland windows besides
> Firefox?

Yes, the only difference is how much the line flicks. With other apps (e.g. Kate or Dolphin), line remains visible all the time instead of flickering like with Firefox.
Comment 7 Schlaefer 2023-01-26 16:50:54 UTC
I see a thin line on top of the bottom panel since 5.26.90. Top panel looks fine. 4k at 175%. (first picture in gallery link bellow)

Setting the 4k display to 100% (no scaling) moves the line to the left edge of the panel. (second picture in gallery link bellow)

Other instances: opening systray items for the first time (4k at 175%). (third picture in gallery link bellow)

Gallery of images showing the issue: https://imgur.com/a/ieKqyG1

Operating System: EndeavourOS 
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 6.2.0-rc4-273-tkg-cfs (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa Intel® Arc
Comment 8 Schlaefer 2023-01-26 16:52:00 UTC
(In reply to Schlaefer from comment #7)
> I see a thin line on top of the bottom panel since 5.26.90. Top panel looks

Forgot to mention: The lines I see are not flickering but static.
Comment 9 Nate Graham 2023-02-06 21:15:06 UTC
*** Bug 464940 has been marked as a duplicate of this bug. ***
Comment 10 Arjen Hiemstra 2023-02-07 13:02:49 UTC
What happens if you disable the blur and/or contrast effects? Does disabling either of them get rid of the line?
Comment 11 Iyán Méndez Veiga 2023-02-08 15:58:13 UTC
(In reply to Arjen Hiemstra from comment #10)
> What happens if you disable the blur and/or contrast effects? Does disabling
> either of them get rid of the line?

Yes! Disabling "Background Constrast" effect solves the issue. Disabling blur does not make a difference. Also, I just noticed that the issue is also visible (although quite less noticeable) in plasma notifications and other menus.
Comment 12 devnulll 2023-02-17 16:05:22 UTC
I can confirm, disabling "Background Contrast" makes it disappear.
Comment 13 Nate Graham 2023-02-17 20:10:41 UTC
*** Bug 465792 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2023-02-17 20:36:56 UTC
*** Bug 465833 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2023-02-17 22:52:25 UTC
*** Bug 465863 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2023-02-17 23:11:03 UTC
*** Bug 465928 has been marked as a duplicate of this bug. ***
Comment 17 poperigby 2023-02-18 17:54:11 UTC
I'm getting an almost identical issue (Wayland, 150% scaling), but disabling Background Contrast doesn't fix it.
Comment 18 ston.jia 2023-02-18 18:00:07 UTC
(In reply to poperigby from comment #17)
> I'm getting an almost identical issue (Wayland, 150% scaling), but disabling
> Background Contrast doesn't fix it.

The same.the problem only occurs when I use wayland session and use 150% scaling, 145% and 155% are normal
Comment 19 Vlad Zahorodnii 2023-02-20 07:49:21 UTC

*** This bug has been marked as a duplicate of bug 465158 ***
Comment 20 Vlad Zahorodnii 2023-02-21 09:05:57 UTC
Git commit edbbe996d33d17ae8020fb06611141586fd1e7bb by Vlad Zahorodnii, on behalf of Arjen Hiemstra.
Committed on 21/02/2023 at 07:50.
Pushed by vladz into branch 'master'.

effects/contrast: Round device coordinates when creating geometry

Since normal geometry is now rounded, we need to make sure to round
anything that should match that geometry, otherwise we risk things
peeking out of the normal geometry.

M  +4    -4    src/effects/backgroundcontrast/contrast.cpp

https://invent.kde.org/plasma/kwin/commit/edbbe996d33d17ae8020fb06611141586fd1e7bb
Comment 21 Vlad Zahorodnii 2023-02-21 09:36:22 UTC
Git commit c3f88fed6211c6023863a749736280733333f970 by Vlad Zahorodnii, on behalf of Arjen Hiemstra.
Committed on 21/02/2023 at 09:08.
Pushed by ahiemstra into branch 'Plasma/5.27'.

effects/contrast: Round device coordinates when creating geometry

Since normal geometry is now rounded, we need to make sure to round
anything that should match that geometry, otherwise we risk things
peeking out of the normal geometry.


(cherry picked from commit edbbe996d33d17ae8020fb06611141586fd1e7bb)

M  +4    -4    src/effects/backgroundcontrast/contrast.cpp

https://invent.kde.org/plasma/kwin/commit/c3f88fed6211c6023863a749736280733333f970
Comment 22 Iyán Méndez Veiga 2023-02-21 11:45:55 UTC
I confirm the patch fixes the issue for me.
Comment 23 Nate Graham 2023-02-21 20:53:11 UTC
*** Bug 465829 has been marked as a duplicate of this bug. ***
Comment 24 Nate Graham 2023-02-21 23:28:26 UTC
*** Bug 466155 has been marked as a duplicate of this bug. ***
Comment 25 Nate Graham 2023-02-21 23:53:02 UTC
*** Bug 466081 has been marked as a duplicate of this bug. ***
Comment 26 Nate Graham 2023-02-22 00:07:37 UTC
*** Bug 466001 has been marked as a duplicate of this bug. ***
Comment 27 Nate Graham 2023-02-22 02:26:00 UTC
*** Bug 465995 has been marked as a duplicate of this bug. ***