Bug 449884

Summary: Text looks cut off and buggy when scrolling using trackpad or mouse
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Logan Turner <loganturner547>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal CC: bomiyr, bugseforuns, jackhill3103, nate, nicolas.fella, noahadvs, radimir.cacic09, raymond.perigo, samuelsumukhreddy, tubbadu
Priority: HI Keywords: regression
Version: 5.90.0   
Target Milestone: Not decided   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.92
Sentry Crash Report:
Attachments: Bad text rendering in discover when scrolling with touchpad
Gammaray screenshot

Description Logan Turner 2022-02-09 20:16:27 UTC
SUMMARY
When scrolling menus in Kirigami apps (System Settings, System Monitor, etc) the text looks buggy and cut off whilst scrolling. 

Changing the compositor rendering settings does not affect this bug, and it persists in both Xorg and Wayland sessions. Using different themes also does not affect this issue, as it persists regardless of QT theme.

Changing trackpad/mouse settings also does not affect this behavior.

STEPS TO REPRODUCE
1. Open a Kirigami app (System Settings for this example).
2. Ensure that the sidebar view is enabled.
3. Scroll up or down slowly in the sidebar or submenus using your trackpad or mouse.

OBSERVED RESULT
The text will look distorted and choppy whilst scrolling. I have a screen recording of the issue as well, which is attached.

EXPECTED RESULT
Text looks smooth and does not become choppy or pixelated when scrolling

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.24
KDE Plasma Version: 5.24
KDE Frameworks Version: 5.90
Qt Version: 5.15.3
Kernel: 5.13.0-28-Generic (X64)

ADDITIONAL INFORMATION
CPU: AMD Athlon 3020e
GPU: AMD Radeon Vega 3 (integrated GPU)
Memory: 4GB
Disk: 128GB SSD
Comment 1 Jack Hill 2022-02-10 00:46:40 UTC
Created attachment 146512 [details]
Bad text rendering in discover when scrolling with touchpad
Comment 2 Patrick Silva 2022-02-10 18:54:53 UTC
Can reproduce on Wayland session of neon unstable while scrolling the effects list in Desktop Effects KCM with touchpad.
Comment 3 Nicolas Fella 2022-02-10 20:20:07 UTC
This kind of issue usually happens when a QML item has a non-integer position. In this case it seems like the scrollview's flickable's child item has a that
Comment 4 Nicolas Fella 2022-02-10 20:55:01 UTC
*** Bug 449970 has been marked as a duplicate of this bug. ***
Comment 5 Nicolas Fella 2022-02-10 20:56:30 UTC
Same thing in systemsettings (https://bugs.kde.org/show_bug.cgi?id=449970)
Comment 6 Nicolas Fella 2022-02-10 20:57:01 UTC
Created attachment 146555 [details]
Gammaray screenshot
Comment 7 Nicolas Fella 2022-02-10 20:58:04 UTC
In all cases there's a RefreshableScrollView involved
Comment 8 Nicolas Fella 2022-02-10 21:57:08 UTC
This seems to be caused by https://invent.kde.org/frameworks/kirigami/-/commit/f6ca218607ff7e5d5066eb3224154c3256cb9516
Comment 9 Noah Davis 2022-02-11 01:51:18 UTC
We should probably round the contentX and contentY position changes in Kirigami WheelHandler.
Comment 10 Noah Davis 2022-02-11 02:16:18 UTC
Actually, isn't there already a solution built into Flickable? Set `pixelAligned: true`. That's technically the correct thing to do. It's not going to work that well with fractional scale factors though. Even if we made a built-in workaround in Kirigami WheelHandler, I'm not sure we'd be able to do much about fractional scale factors.
Comment 11 Noah Davis 2022-02-11 02:19:18 UTC
The ideal fix would be to fix the text elements in Qt so that they don't glitch out when given fractional positions.
Comment 12 Behzad A 2022-02-11 10:06:48 UTC
*** Bug 449979 has been marked as a duplicate of this bug. ***
Comment 13 Nicolas Fella 2022-02-11 13:50:19 UTC
*** Bug 450011 has been marked as a duplicate of this bug. ***
Comment 14 Bug Janitor Service 2022-02-11 14:26:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/494
Comment 15 Noah Davis 2022-02-11 14:44:42 UTC
Git commit de215e196ed8b40a4abf5fa0da6c59adeba30187 by Noah Davis.
Committed on 11/02/2022 at 14:26.
Pushed by ndavis into branch 'master'.

WheelHandler: Round contentX/contentY positions

I'm basically forcing pixel alignment because I don't see a reason not
to when scrolling with a touchpad or mouse wheel. We should ideally also
fix this in Qt so that workarounds like these aren't necessary.

https://bugs.kde.org/show_bug.cgi?id=449884

M  +15   -0    src/wheelhandler.cpp

https://invent.kde.org/frameworks/kirigami/commit/de215e196ed8b40a4abf5fa0da6c59adeba30187
Comment 16 Nicolas Fella 2022-02-11 23:58:30 UTC
*** Bug 450055 has been marked as a duplicate of this bug. ***
Comment 17 bomiyr 2022-02-15 19:39:06 UTC
*** Bug 446048 has been marked as a duplicate of this bug. ***