[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Review Request 126513: Refactor kcm touchpad to fix some issue related to hotplug touchpad
From:       "David Edmundson" <david () davidedmundson ! co ! uk>
Date:       2016-01-10 18:43:48
Message-ID: 20160110184348.23702.47346 () mimi ! kde ! org
[Download RAW message or body]

--===============3696456815765337758==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit


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

Ship it!


Hard to review a big shuffle, but it looks fine to me.


kcms/touchpad/src/backends/x11/propertyinfo.cpp (line 51)
<https://git.reviewboard.kde.org/r/126513/#comment62071>

    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.


- David Edmundson


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
> 
> 


--===============3696456815765337758==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/126513/">https://git.reviewboard.kde.org/r/126513/</a>
  </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Hard \
to review a big shuffle, but it looks fine to me.</p></pre>  <br />







<div>



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/126513/diff/3/?file=425999#file425999line51" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kcms/touchpad/src/backends/x11/propertyinfo.cpp</a>  <span \
style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">51</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="k">if</span> <span class="p">(</span><span class="n">format</span> <span \
class="o">==</span> <span class="n">CHAR_BIT</span> <span class="o">&amp;&amp;</span> \
<span class="n">type</span> <span class="o">==</span> <span \
class="n">XA_INTEGER</span><span class="p">)</span> <span \
class="p">{</span></pre></td>  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">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.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">but this is the same as hte original \
code, so it's fine.</p></pre>  </div>
</div>
<br />



<p>- David Edmundson</p>


<br />
<p>On December 25th, 2015, 7:02 p.m. UTC, Xuetian Weng wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for Plasma and David Edmundson.</div>
<div>By Xuetian Weng.</div>


<p style="color: grey;"><i>Updated Dec. 25, 2015, 7:02 p.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://bugs.kde.org/show_bug.cgi?id=349545">349545</a>, 

 <a href="https://bugs.kde.org/show_bug.cgi?id=356923">356923</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-desktop
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">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.  </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">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.</p> <ol \
style="padding: 0;text-rendering: inherit;margin: 0 0 0 2em;line-height: \
inherit;white-space: normal;"> <li style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: normal;"> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">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.</p> </li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: normal;"> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">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.</p> </li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: normal;"> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">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.</p> </li>
</ol></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Without touchpad -&gt; login -&gt; plug touchpad -&gt; \
settings applied to device using libinput driver. unplug -&gt; replug -&gt; settings \
applied to device using libinput driver.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">Disable touchpad -&gt; \
applet shows up -&gt; unplug touchpad -&gt; applet hides -&gt; replug touchpad -&gt; \
touchpad is still disabled, and applet shows up -&gt; enable touhcpad -&gt; applet \
hides.</p></pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kcms/touchpad/src/applet/qml/contents/ui/touchpad.qml <span style="color: \
grey">(8dec7c2)</span></li>

 <li>kcms/touchpad/src/applet/touchpadengine.h <span style="color: \
grey">(16b98c2)</span></li>

 <li>kcms/touchpad/src/applet/touchpadengine.cpp <span style="color: \
grey">(eae429e)</span></li>

 <li>kcms/touchpad/src/backends/x11.cmake <span style="color: \
grey">(c9fcea8)</span></li>

 <li>kcms/touchpad/src/backends/x11/libinputproperties.c <span style="color: \
grey">(9dbf9ea)</span></li>

 <li>kcms/touchpad/src/backends/x11/libinputtouchpad.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kcms/touchpad/src/backends/x11/libinputtouchpad.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kcms/touchpad/src/backends/x11/propertyinfo.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kcms/touchpad/src/backends/x11/propertyinfo.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kcms/touchpad/src/backends/x11/synapticstouchpad.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kcms/touchpad/src/backends/x11/synapticstouchpad.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kcms/touchpad/src/backends/x11/synclientproperties.h <span style="color: \
grey">(43d18d2)</span></li>

 <li>kcms/touchpad/src/backends/x11/synclientproperties.c <span style="color: \
grey">(5fd1ed6)</span></li>

 <li>kcms/touchpad/src/backends/x11/xlibbackend.h <span style="color: \
grey">(7cecb4a)</span></li>

 <li>kcms/touchpad/src/backends/x11/xlibbackend.cpp <span style="color: \
grey">(b55a45f)</span></li>

 <li>kcms/touchpad/src/backends/x11/xlibtouchpad.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kcms/touchpad/src/backends/x11/xlibtouchpad.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kcms/touchpad/src/kded/kded.h <span style="color: grey">(9b8fe6e)</span></li>

 <li>kcms/touchpad/src/kded/kded.cpp <span style="color: grey">(409126b)</span></li>

 <li>kcms/touchpad/src/touchpadbackend.h <span style="color: \
grey">(b225ed9)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/126513/diff/" style="margin-left: \
3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>


--===============3696456815765337758==--


[Attachment #3 (text/plain)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic