Bug 476536

Summary: New overview/grid animation does not feel as precise when using touchpad gestures
Product: [Plasma] kwin Reporter: Prajna Sariputra <putr4.s>
Component: effects-overviewAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: dev.bacteriostat, fanzhuyifan, nate, niccolo
Priority: NOR Keywords: qt6
Version: master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Prajna Sariputra 2023-11-04 08:38:31 UTC
SUMMARY
In Plasma 5, the overview and desktop grid effects had great one-to-one touchpad gestures, as in that the progress of the animation feels tied exactly to where my fingers were on the touchpad. However, on Plasma 6 the new overview/grid effect feels laggier, like it's slightly behind what my fingers were actually doing.

The issue is especially clear at slower animation speeds, for example if I do the 4 finger down gesture quickly but stop halfway the animation will take its time before arriving at where my fingers are, and then if I finish the gesture quickly the animation will also take its time before finishing. This is in contrast to the slide animation for switching between virtual desktops, which will always follow the speed of my fingers as long as I keep them on the touchpad, regardless of the animation speed.

The issue goes away if I set the animation speed to Instant, in that case the animation feels just as great as it did in Plasma 5 as long as I keep my fingers on the touchpad the whole way, although of course the problem with that workaround is that all other animations are gone.


STEPS TO REPRODUCE
1. Lower the animation speed (optional, so the problem is more obvious)
2. Do either a 4 finger up or 4 finger down touchpad gesture, but stop halfway and keep all 4 fingers on the touchpad

OBSERVED RESULT
The overview/grid animation stops after the motion of the fingers stop.

EXPECTED RESULT
The overview/grid animation stops at the same time as the fingers do.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0
Kernel Version: 6.5.9-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 6800H with Radeon Graphics
Memory: 30.6 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
This is on a kdesrc-build session of Plasma 6, with KWin at commit abf642d42e8189deaabf1999661e83aab25b99fa.
Comment 1 Nate Graham 2023-11-08 21:22:25 UTC
> The issue goes away if I set the animation speed to Instant

That's quite a relevant data point, thanks. I can reproduce your observations. It would appear that some of the transitions here are inappropriately using an animation with a nonzero duration, so when you activate the gesture with a finger, a gazillion animations fire off, even though none of them are needed since toughpad gestures are supposed to be finger-following and hence just use non-animated/linear transitions. We on;y want to play the animations when activating the effect with something that's *not* a touchpad gesture.
Comment 2 Bug Janitor Service 2023-11-09 14:46:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4621
Comment 3 Nate Graham 2023-11-15 17:41:06 UTC
Git commit 9e81d2f65c8c4ecdf94f81e7ca15b4bcc0995fb0 by Nate Graham, on behalf of Niccolò Venerandi.
Committed on 15/11/2023 at 18:41.
Pushed by ngraham into branch 'master'.

plugins/overview: Bind values to 1:1 animation while gesture is ongoing

Otherwise the animation feels wrong while activating with a gesture.
Now when a 1:1 gesture is ongoing, then the Overview effect will stop
animating the overviewVal/gridVal values. I implemented this by porting
to states, giving 1:1 gestures their own states, and only animating the
change between states.

M  +3    -2    src/libkwineffects/effecttogglablestate.cpp
M  +0    -5    src/plugins/overview/overvieweffect.cpp
M  +82   -27   src/plugins/overview/qml/main.qml

https://invent.kde.org/plasma/kwin/-/commit/9e81d2f65c8c4ecdf94f81e7ca15b4bcc0995fb0
Comment 4 fanzhuyifan 2024-01-20 07:08:50 UTC
I still feel that using touchpad swipes to switch desktops in overview mode feels qualitatively different from the sliding desktop effect. This is a minor point, but I feel that some more consistency is good.

In particular, with the sliding desktop effect, I feel that there is perfect 1:1 correspondence between the swipes and the locations of desktops on the screen. But in the overview mode, I notice some sort of weird acceleration when I am about to completely switch to a new desktop.

Also, the distance that I need to swipe feels slightly different (I am less sure about this).

Would it be appropriate to reopen this report or should I submit a new one?
Comment 5 Prajna Sariputra 2024-01-20 07:30:43 UTC
The issue with the desktop switching animation in the overview was noted in the merge request discussion (https://invent.kde.org/plasma/kwin/-/merge_requests/4621#note_804254), Niccolò said that the fix for that would be more complex.

So, I'd say it would be better to open a new bug report to focus on that animation specifically, given the apparent difference between it and the rest of the overview/grid effect.