Review Request 126513: Refactor kcm touchpad to fix some issue related to hotplug touchpad

Xuetian Weng wengxt at gmail.com
Mon Jan 11 20:53:01 UTC 2016



> On Jan. 10, 2016, 6:43 p.m., David Edmundson wrote:
> > kcms/touchpad/src/backends/x11/propertyinfo.cpp, line 51
> > <https://git.reviewboard.kde.org/r/126513/diff/3/?file=425999#file425999line51>
> >
> >     Effectively we end up switching on the data type twice; both here and in value()
> >     Given we store the format, I'd merge this into value() and drop the b,i,f member variables.
> >     
> >     but this is the same as hte original code, so it's fine.

synapthcs uses b,i,f fields directly, keep it as it is looks easier for those code to access the value instead of always using QVariant.

Maybe clean up that part later.


- Xuetian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126513/#review90841
-----------------------------------------------------------


On Dec. 25, 2015, 7:02 p.m., Xuetian Weng wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126513/
> -----------------------------------------------------------
> 
> (Updated Dec. 25, 2015, 7:02 p.m.)
> 
> 
> Review request for Plasma and David Edmundson.
> 
> 
> Bugs: 349545 and 356923
>     https://bugs.kde.org/show_bug.cgi?id=349545
>     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/applet/qml/contents/ui/touchpad.qml 8dec7c2 
>   kcms/touchpad/src/applet/touchpadengine.h 16b98c2 
>   kcms/touchpad/src/applet/touchpadengine.cpp eae429e 
>   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.
> 
> 
> Disable touchpad -> applet shows up -> unplug touchpad -> applet hides -> replug touchpad -> touchpad is still disabled, and applet shows up -> enable touhcpad -> applet hides.
> 
> 
> Thanks,
> 
> Xuetian Weng
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160111/ff7cd5a7/attachment-0001.html>


More information about the Plasma-devel mailing list