Summary: | Add inertial scrolling to WheelHandler for touchpad and touchscreen scrolls | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kirigami | Reporter: | Andrew Shark <ashark> |
Component: | general | Assignee: | Marco Martin <notmart> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | bugs.kde.org, chermnykh2001, contact, d.edwards-dale, elvisisvan, guido.iodice, guimarcalsilva, Hi-Angel, hujq, kde-yyds, kimiblock, kripton, luna, nate, niccolo, nicolas.fella, nils1, noahadvs, thederpyworld, uwu |
Priority: | NOR | Keywords: | usability |
Version First Reported In: | unspecified | ||
Target Milestone: | Not decided | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/kirigami/-/commit/5d6d0fe05eee3a34500ee20f7aa0a752b1c96242 | Version Fixed In: | 6.17 |
Sentry Crash Report: |
Description
Andrew Shark
2022-07-06 07:28:12 UTC
If you're saying that we in KDE should forcibly inject inertia ourselves at the driver level (like Synaptics did), that's not really possible. On X11, we don't control the part of the stack where it would need to be implemented. On Wayland, we could do it, but our implementation will conflict with toolkits that already do it themselves, so there will be double-inertia all over the place, in addition to creating an endless number of other issues like Bug 443819 and Bug 403285. Imagine those everywhere. It's not really feasible. The right approach is to implement inertia in toolkits' scrollviews. GTK and Electron already generally do this, and Qt also does for QtQuick-based software. We just need to turn it on, for the most part. There are a few complications, such as the fact that we actually override a lot of the default QtQuick scroll behaviors with something called WheelHandler which lives in Kirigami, so it would need to be implemented there. So I'll move this to Kirigami as the biggest thing that would need to be changed is WheelHandler. For QtWidgets-based apps, it's largely hopeless, unfortunately. Someone would need to implement inertia in the QtWidgets scrollview, which seems unlikely as widgets are semi-frozen. QScroller can be used to enable kinetic scrolling in QtWidgets apps. It's not a magic switch that enables it out-of-the-box everywhere though Yes, it would have to be implemented in each of our five hundred million QtWidgets-based scrollviews, which was what led me to my conclusion that it would be "largely hopeless." even if there exist an "inertia scrolling" checkbox it will only effective on x11 because wayland hasn't natively implemented inertia scrolling system-wide, still I'm pushing commits to https://invent.kde.org/kde-yyds/kirigami-work/-/tree/work-kinetic-scroll It's still very buggy in some applications at the time. I will open a pull request when it's more usable. In the works with https://invent.kde.org/frameworks/kirigami/-/merge_requests/1817 Now merged! I updated kde plasma and built kirigami manually to test it. The problem in systemsettings still exist. And it seems that touchpad scroll is recognized as mouse wheel that triggers smooth scrolling. With kde framework 6.16 installed, plasma 6.4.3, no intertial scrolling. I tried system information and other kirigami apps. perating System: Manjaro Linux KDE Plasma Version: 6.4.3 KDE Frameworks Version: 6.16.0 Qt Version: 6.9.1 Kernel Version: 6.16.0-rc6-1-MANJARO (64-bit) Graphics Platform: Wayland Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz Memory: 16 GiB of RAM (15.3 GiB usable) Graphics Processor: Intel® Iris® Xe Graphics Inertial scrolling is kinda there now, but it only works if you keep your fingers on the trackpad after moving them. The scroll view then continues to scroll for a bit, even though your fingers don't. But if you lift your fingers, the scrolling stops immediately. In some scroll views, this feels worse than before, and really unexpected. It's the opposite of how it's implemented in Firefox, GTK or anywhere really, where it only flings when you lift your fingers, and stops moving when your fingers stop if they are still on the trackpad. Is the current behaviour intended? KDE Plasma Version: 6.4.3 KDE Frameworks Version: 6.16.0 (In reply to Nils from comment #11) > Inertial scrolling is kinda there now, but it only works if you keep your > fingers on the trackpad after moving them. > > KDE Plasma Version: 6.4.3 > KDE Frameworks Version: 6.16.0 I hope this can be changed because it doesn't make much sense; in fact, it's counterproductive. What you're describing sounds like a bug. It's certainly not the intention, and I can't reproduce it myself. If it's 100% reproducible for you, we'd appreciate a new bug report about it. Thanks! (In reply to Nate Graham from comment #13) > What you're describing sounds like a bug. It's certainly not the intention, > and I can't reproduce it myself. > > If it's 100% reproducible for you, we'd appreciate a new bug report about > it. Thanks! I can't reproduce this behaviour either. Kinetic scrolling simply doesn't work at all. I wouldn't want him to be fooled by the micro-movements of the fingertips that can occur if you suddenly stop scrolling. (In reply to Nate Graham from comment #13) > What you're describing sounds like a bug. It's certainly not the intention, > and I can't reproduce it myself. > > If it's 100% reproducible for you, we'd appreciate a new bug report about > it. Thanks! Not sure if I got something wrong, but I had a look at the code of the commit. The inertial scrolling is triggered when wheelEvent->isEndEvent(). wheelEvent is a QWheelEvent, so I had a look at the Qt 6.9 docs. The function "Returns true if this event's phase() is Qt::ScrollEnd.", but turns out "The Qt::ScrollBegin and Qt::ScrollEnd phases are currently supported only on macOS." Would be astounded if it never worked at all, but it definitely doesn't for me. Will look into this further tomorrow. The behaviour I noticed when keeping the fingers on the trackpad might well not be inertial scrolling. There is a gradual slowdown after the fingers stop, and it feels drastically different to non-kirigami apps, but I can't fling the view a whole lot. (In reply to Nils from comment #15) > (In reply to Nate Graham from comment #13) > > What you're describing sounds like a bug. It's certainly not the intention, > > and I can't reproduce it myself. > > > > If it's 100% reproducible for you, we'd appreciate a new bug report about > > it. Thanks! > > Not sure if I got something wrong, but I had a look at the code of the > commit. The inertial scrolling is triggered when wheelEvent->isEndEvent(). > wheelEvent is a QWheelEvent, so I had a look at the Qt 6.9 docs. The > function "Returns true if this event's phase() is Qt::ScrollEnd.", but turns > out "The Qt::ScrollBegin and Qt::ScrollEnd phases are currently supported > only on macOS." > > Would be astounded if it never worked at all, but it definitely doesn't for > me. Will look into this further tomorrow. The behaviour I noticed when > keeping the fingers on the trackpad might well not be inertial scrolling. > There is a gradual slowdown after the fingers stop, and it feels drastically > different to non-kirigami apps, but I can't fling the view a whole lot. After today's updates it works, and I love it! Thanks so much!
> After today's updates it works, and I love it! Thanks so much!
I confirm
|