Review Request 126513: Refactor kcm touchpad to fix some issue related to hotplug touchpad
Xuetian Weng
wengxt at gmail.com
Fri Dec 25 06:39:41 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126513/
-----------------------------------------------------------
Review request for Plasma and David Edmundson.
Bugs: 356923
https://bugs.kde.org/show_bug.cgi?id=356923
Repository: plasma-desktop
Description
-------
Currently, there are some mixed issue in kcm touchpad related to libinput backend and hot plug.
There are several issues:
1. only one backend maybe used at runtime, either synaptics or libinput. But libinput backend will only be used if there is a libinput backend present. Which means if libinput touchpad is not present at login, kded will not be able to properly support them.
2. hotplug touchpad will always set touchpad to disabled.
3. hotplug touchpad will not get configuration applied.
4. The libinput devices detection may pick some non-touchpad device.
To solve these problems, following changes are made:
1. Remove SynapticsBackend and LibinputBackend and add three new classes called XlibTouchpad/SynapticsTouchpad/LibinputTouchpad. So findTouchpad may pick up both synaptics or libinput device, and no need to depend on a fixed backend. This change also make it easier to support multiple touchpad device easier if needed.
2. hotplug touchpad config not being applied (bug 356923) is mainly because one can't apply settings to a disabled device. Change the statement order in handleReset, apply settings first then set enable status.
3. findTouchpad() is changed to use XListInputDevices, because it provides necessary information of device type in order to filter out non-touchpad device. xf86-input-libinput doesn't have a unique atom for touchpad, so current identityAtom cannot guarantee that findTouchpad always returns a touchpad device for libinput.
4. On my surface pro 4 system, if touchpad is unpluged, the device will be set to disabled automatically first, then touchpadDetached is called, which makes m_enabled in TouchpadDisabled always to be false after unplug the touchapd. This patch makes TouchpadDisabler have two different enabled property. m_userRequestedState only stores the user requested status, so when handleReset is called, it can properly set enabled state to the last user requested state.
Diffs
-----
kcms/touchpad/src/backends/x11.cmake c9fcea8
kcms/touchpad/src/backends/x11/libinputproperties.c 9dbf9ea
kcms/touchpad/src/backends/x11/libinputtouchpad.h PRE-CREATION
kcms/touchpad/src/backends/x11/libinputtouchpad.cpp PRE-CREATION
kcms/touchpad/src/backends/x11/propertyinfo.h PRE-CREATION
kcms/touchpad/src/backends/x11/propertyinfo.cpp PRE-CREATION
kcms/touchpad/src/backends/x11/synapticstouchpad.h PRE-CREATION
kcms/touchpad/src/backends/x11/synapticstouchpad.cpp PRE-CREATION
kcms/touchpad/src/backends/x11/synclientproperties.h 43d18d2
kcms/touchpad/src/backends/x11/synclientproperties.c 5fd1ed6
kcms/touchpad/src/backends/x11/xlibbackend.h 7cecb4a
kcms/touchpad/src/backends/x11/xlibbackend.cpp b55a45f
kcms/touchpad/src/backends/x11/xlibtouchpad.h PRE-CREATION
kcms/touchpad/src/backends/x11/xlibtouchpad.cpp PRE-CREATION
kcms/touchpad/src/kded/kded.h 9b8fe6e
kcms/touchpad/src/kded/kded.cpp 409126b
kcms/touchpad/src/touchpadbackend.h b225ed9
Diff: https://git.reviewboard.kde.org/r/126513/diff/
Testing
-------
Without touchpad -> login -> plug touchpad -> settings applied to device using libinput driver.
unplug -> replug -> settings applied to device using libinput driver.
Thanks,
Xuetian Weng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20151225/0d57ade1/attachment-0001.html>
More information about the Plasma-devel
mailing list