Bug 356923

Summary: Touchpad settings not applied upon touchpad plugin
Product: [Applications] systemsettings Reporter: Weng Xuetian <wengxt>
Component: kcm_touchpadAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 5.17.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.6.0
Sentry Crash Report:

Description Weng Xuetian 2015-12-19 22:53:09 UTC
Touch pad for surface pro maybe plug and unplug at runtime. The configuration of touchpad is not applied when plugin the type cover.

Reproducible: Always

Steps to Reproduce:
1. unplugin type cover
2. plugin type cover

Actual Results:  
Touchpad configuration is not applied.

Expected Results:  
Touchpad configuration applied.
Comment 1 Weng Xuetian 2016-01-11 20:54:18 UTC
Git commit a39677c1fd1e6303ddaf31da5ccd0a6454104066 by Weng Xuetian.
Committed on 11/01/2016 at 20:38.
Pushed by xuetianweng into branch 'master'.

Refactor kcm touchpad to fix some issue related to hotplug touchpad

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.

REVIEW: 126513
Related: bug 349545
FIXED-IN: 5.6.0

M  +2    -2    kcms/touchpad/src/applet/qml/contents/ui/touchpad.qml
M  +7    -6    kcms/touchpad/src/applet/touchpadengine.cpp
M  +1    -0    kcms/touchpad/src/applet/touchpadengine.h
M  +5    -3    kcms/touchpad/src/backends/x11.cmake
R  +28   -2    kcms/touchpad/src/backends/x11/libinputtouchpad.cpp [from: kcms/touchpad/src/backends/x11/libinputproperties.c - 059% similarity]
C  +7    -22   kcms/touchpad/src/backends/x11/libinputtouchpad.h [from: kcms/touchpad/src/applet/touchpadengine.h - 055% similarity]
A  +90   -0    kcms/touchpad/src/backends/x11/propertyinfo.cpp     [License: GPL (v2+)]
C  +23   -18   kcms/touchpad/src/backends/x11/propertyinfo.h [from: kcms/touchpad/src/applet/touchpadengine.h - 060% similarity]
R  +178  -69   kcms/touchpad/src/backends/x11/synapticstouchpad.cpp [from: kcms/touchpad/src/backends/x11/synclientproperties.c - 053% similarity]
C  +12   -20   kcms/touchpad/src/backends/x11/synapticstouchpad.h [from: kcms/touchpad/src/applet/touchpadengine.h - 056% similarity]
D  +0    -71   kcms/touchpad/src/backends/x11/synclientproperties.h
M  +79   -557  kcms/touchpad/src/backends/x11/xlibbackend.cpp
M  +20   -30   kcms/touchpad/src/backends/x11/xlibbackend.h
A  +292  -0    kcms/touchpad/src/backends/x11/xlibtouchpad.cpp     [License: UNKNOWN]  *
A  +88   -0    kcms/touchpad/src/backends/x11/xlibtouchpad.h     [License: GPL (v2+)]
M  +39   -13   kcms/touchpad/src/kded/kded.cpp
M  +5    -1    kcms/touchpad/src/kded/kded.h
M  +2    -1    kcms/touchpad/src/touchpadbackend.h

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/plasma-desktop/a39677c1fd1e6303ddaf31da5ccd0a6454104066