Bug 396269

Summary: Touchpad settings are changed when another mouse is connected
Product: [Applications] systemsettings Reporter: Andrew Chen <andrew>
Component: kcm_mouseAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: major CC: adr.fantini, alexmasonpro, brucerash, kde, mail, matejm98mthw, mathias.ciliberto, nate, subdiff, unassigned-bugs
Priority: NOR    
Version: 5.13.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.14.0
Sentry Crash Report:

Description Andrew Chen 2018-07-06 23:51:25 UTC
Steps to reproduce:
1. Enable natural scrolling in system settings -> touchpad
2. Connect a mouse (I used bluetooth, but usb should also work)
3. Observe natural scrolling is no longer active on the touchpad
4. Also the touchpad settings display a warning that active settings don't match saved settings

I suspect this is caused by kcm_mouse applying the mouse settings to all pointer devices (including touchpad?) when a new pointer device is connected.

I see
> Initializing  "kcm_mouse" :  "kcminit_mouse"
in the system logs when I connect the mouse.
Comment 1 Alex Mason 2018-07-07 10:48:28 UTC
Also having this issue. Same issue occurs when entering kcm_mouse and hitting 'Apply' - mouse settings get applied to the touchpad.
Comment 2 Nate Graham 2018-07-13 19:38:37 UTC
Libinput has the ability to configure these on a per-device-class basis, so it's a bug.

Roman, what I suspect is happening is that the new-in-5.13 Libinput Mouse KCM is writing to the same settings that the old Libinput Touchpad KCM has been reading from, so it stomps on them.
Comment 3 Roman Gilg 2018-07-14 08:49:36 UTC
No, I think Andrew is right in his assumption, that the Mouse KCM applies the settings wrongly to all pointer devices and not only to Mice.
Comment 4 Alex Mason 2018-07-14 10:05:27 UTC
Related: https://bugs.kde.org/show_bug.cgi?id=395722

Running kcminit kcm_touchpad as suggested in the above bug report returns the correct touchpad settings. Also, this bug occurs when "Disable touchpad when mouse is plugged in" setting is active. Uupon unplugging mouse and touchpad is re-enabled, touchpad settings are not applied until running kcminit kcm_touchpad.
Comment 5 Matej Mrenica 2018-07-14 11:21:56 UTC
My problem is acting exactly like Alex described, but there is more. If touchpad settings are overwritten every time mouse settings change then why are mouse settings changing by themselves every few minutes.
Comment 6 Bruce R. 2018-08-31 17:58:05 UTC
Experiencing on Fedora 28 64-bit, Plasma 5.13.4.
Comment 7 Roman Gilg 2018-09-12 17:29:36 UTC
Git commit a4c724173b5c6a59331587f2e5db746dffbabdc6 by Roman Gilg.
Committed on 12/09/2018 at 17:29.
Pushed by romangilg into branch 'master'.

[Mouse KCM] Avoid changes to touchpads in libinput backend

Summary:
Similar to evdev backend we need to ignore touchpad devices explicitly in the
libinput backend because these are also pointer devices.

XInput2 can do this in theory via input classes, but my touchpad did not set
the class correctly. So just switch to using XInput like in the evdev backend
to query all pointer devices and then use the XI_TOUCHPAD atom to filter out
touchpads.
Related: bug 395401, bug 395722

Test Plan: Manually

Reviewers: #plasma, hein

Reviewed By: #plasma, hein

Subscribers: acrouthamel, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D15256

M  +20   -12   kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp

https://commits.kde.org/plasma-desktop/a4c724173b5c6a59331587f2e5db746dffbabdc6