Bug 427771

Summary: Flat/Adaptive pointer acceleration setting does nothing on wayland
Product: [Applications] systemsettings Reporter: Nicolas F. <kdebugs>
Component: kcm_touchpadAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: afifkamarulimran98, auxsvr, bugseforuns, butirsky, d345934, eduardo.cruz, jessica, miranda, nate, nicopwn, nl6720
Priority: NOR Keywords: wayland
Version: 5.22.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.23.5
Attachments: Video of the bug in action

Description Nicolas F. 2020-10-15 17:52:50 UTC
Launching a Plasma Wayland session and going into the touchpad settings, one can change the flat/adaptive radio button option for pointer acceleration with no effect. In fact, hitting apply shows the options as immediately being reverted back to its previous state. The same appears to apply for natural scrolling, which seems to be forced on for some applications on Wayland, even if the settings show it as being off.

STEPS TO REPRODUCE
1. Open system settings -> touchpad
2. Click on "Flat" instead of "Adaptive"
3. Hit "Apply"

OBSERVED RESULT
Pointer acceleration remains, GUI immediately reverts to the option "Adaptive" being checked

EXPECTED RESULT
Setting is actually changed

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.20
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION
Works fine on X11, also using libinput.

Occasionally, the "Adaptive" or "Flat" choice doesn't show up at all; in those cases, clicking on some other settings menu then going back makes it appear. Weird. This also happens on X11 sometimes, though.
Comment 1 Nate Graham 2020-10-16 17:03:28 UTC
Huh.

Is this a regression from 5.19, or has it always been broken? Or did you just notice now and don't know?
Comment 2 Nicolas F. 2020-10-18 03:10:43 UTC
Has always been broken, not a regression from 5.19. In fact, the only reason why I even tried to use Wayland was to see if it was still broken so that I could report it.
Comment 3 Nicolas F. 2020-10-26 01:57:49 UTC
I've done some more sleuthing. Initially I thought this was related to some old unmaintained third party kcm I've had installed - "kcm-pointing-devices", but no, after removing it and restarting my computer, and logging back into Wayland, the problem still persisted. I've tried seeing if `kcmshell5 kcm_touchpad` produces any interesting output when toggling options, but to no avail.

Is there some console utility to read out and alter the current touchpad settings on KWin Wayland? That way I might narrow it down as to whether it's a UI issue, otherwise I'll just try and get a KDE dev environment set up when I have the time and litter the KCM with debug printfs until I find what's causing this.

Hilariously, the Flat/Adaptive toggle works for "Mouse", namely my Thinkpad's included red nipple thing. So it's either specific to the Synaptics touchpad, or specific to the Touchpad UI.

I'm also not sure if natural scrolling is just an artefact of SystemSettings being weird, it works as expected in all other Qt applications. I'll disregard it for now and assume that's a completely separate issue.
Comment 4 Nicolas F. 2021-06-09 18:22:41 UTC
Created attachment 139161 [details]
Video of the bug in action

Here's a screen recording of the bug in action. Note that the option only appears when I looked at the Mouse tab before, which has it by default. Pointer acceleration at 0.00 does not actually disable pointer acceleration.
Comment 5 cauchy 2021-06-11 08:15:21 UTC
I can confrim with KDE 5.22 full wayland on the Arch Linux. KDE settings acts the same: the radio button switches at the save action and setting acceleration to 0 doesn't make acceleration flat but rather slow.
Comment 6 d345934 2021-08-04 09:47:42 UTC
Can report the same issue on KDE 5.22 on Arch Linux
I have managed to manually set the input properties in DBus, that successfully changed the acceleration profile, and weirdly after doing that I can't change the acceleration profile back to Adaptive from the GUI, it immediately reverts just like it did when I was trying to change the profile from Adaptive.
Here's the command if anyone wants to test.
touchpad=$(libinput list-devices | sed -rn '/Touchpad/{n;s/.*(event[0-9]+)/\1/p}') # or just eventN if it didn't work
dbus-send --dest=org.kde.KWin "/org/kde/KWin/InputDevice/$touchpad" org.freedesktop.DBus.Properties.Set string:org.kde.KWin.InputDevice string:pointerAccelerationProfileFlat variant:bool:true
dbus-send --dest=org.kde.KWin "/org/kde/KWin/InputDevice/$touchpad" org.freedesktop.DBus.Properties.Set string:org.kde.KWin.InputDevice string:pointerAccelerationProfileAdaptive variant:bool:false
Comment 7 Eduardo 2021-09-10 04:06:34 UTC
Happens to me under Wayland on ArchLinux. Under XOrg it works fine.
I'm changing to CONFIRMED.
Comment 8 Afif 2021-12-12 14:16:50 UTC
System information:
- Distro: Arch Linux
- Qt version: 5.15.2
- KDE Plasma version: 5.23.4
- KDE Frameworks version: 5.88.0

Steps to reproduce: 
1) Enter "System Settings"
2) Click on "Input Devices"
3) Click on "Touchpad"
4) At "Acceleration profile" option, click "Flat"
5) Click on "Apply" button
6) Touchpad "Acceleration profile" setting unexpectedly reverts back to "Adaptive"

Additional information: 
- Reproduced on a Wayland session
Comment 9 Bug Janitor Service 2021-12-16 14:51:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/754
Comment 10 Arjen Hiemstra 2021-12-16 14:59:50 UTC
Git commit 119f55b218722310ad4b94c68f607b0fa4b7864c by Arjen Hiemstra.
Committed on 16/12/2021 at 14:49.
Pushed by ahiemstra into branch 'master'.

Touchpad KCM: Don't write default values to active config

The default values are the default, so this doesn't make a lot of sense.

M  +2    -2    kcms/touchpad/backends/kwin_wayland/kwinwaylandtouchpad.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/119f55b218722310ad4b94c68f607b0fa4b7864c
Comment 11 Arjen Hiemstra 2021-12-16 15:00:27 UTC
Git commit 294fd6306d94238d16288e78bdf544f0ea82b790 by Arjen Hiemstra.
Committed on 16/12/2021 at 15:00.
Pushed by ahiemstra into branch 'Plasma/5.23'.

Touchpad KCM: Don't write default values to active config

The default values are the default, so this doesn't make a lot of sense.


(cherry picked from commit 119f55b218722310ad4b94c68f607b0fa4b7864c)

M  +2    -2    kcms/touchpad/backends/kwin_wayland/kwinwaylandtouchpad.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/294fd6306d94238d16288e78bdf544f0ea82b790