summaryrefslogtreecommitdiff
path: root/src/synaptics.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-02-21 10:31:37 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2014-02-24 08:25:29 +1000
commiteea73358760c7ff9c9dac061f265753637c6f25c (patch)
tree967bbc711cf278afcdf937b789c4a8c97014be6e /src/synaptics.c
parentac78616d074f2d248543411c106f0d1befeef58d (diff)
Add another third state to TouchpadOff for disabling all but button clicks
On a new set of laptops like the Lenovo T440 the trackstick does not have physical buttons. Instead, the touchpad's top edge is supposed to acts software button area. To avoid spurious cursor jumps when the trackstick is in use and the finger is resting on the touchpad, add another mode that disables motion events. Enabled by syndaemon with -t click-only, the default stays unchanged. No specific integration with the traditional disable-while-typing is needed. On such touchpads, disabling motion events is sufficient to avoid spurious events and we don't want to stop HW buttons to send events. Note that this only adds the new state to the driver and to syndaemon, there is nothing hooked up otherwise to actually monitor the trackstick. Special note for syndaemon: optional arguments are a GNU extension, so work around it by messing with an optstring starting with ":" which allows us to manually parse the options. Original version of this patch by John Pham <jhnphm@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/synaptics.c')
-rw-r--r--src/synaptics.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 282ced7..6eb3ff8 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1763,7 +1763,8 @@ SelectTapButton(SynapticsPrivate * priv, enum EdgeType edge)
{
enum TapEvent tap;
- if (priv->synpara.touchpad_off == TOUCHPAD_TAP_OFF) {
+ if (priv->synpara.touchpad_off == TOUCHPAD_TAP_OFF ||
+ priv->synpara.touchpad_off == TOUCHPAD_CLICK_ONLY) {
priv->tap_button = 0;
return;
}
@@ -2302,7 +2303,9 @@ HandleScrolling(SynapticsPrivate * priv, struct SynapticsHwState *hw,
SynapticsParameters *para = &priv->synpara;
int delay = 1000000000;
- if ((priv->synpara.touchpad_off == TOUCHPAD_TAP_OFF) || (priv->finger_state == FS_BLOCKED)) {
+ if ((priv->synpara.touchpad_off == TOUCHPAD_TAP_OFF) ||
+ (priv->synpara.touchpad_off == TOUCHPAD_CLICK_ONLY) ||
+ (priv->finger_state == FS_BLOCKED)) {
stop_coasting(priv);
priv->circ_scroll_on = FALSE;
priv->vert_scroll_edge_on = FALSE;
@@ -2909,6 +2912,9 @@ HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw)
Bool restart_touches = FALSE;
int i;
+ if (para->touchpad_off == TOUCHPAD_CLICK_ONLY)
+ goto out;
+
if (para->click_action[F3_CLICK1] || para->tap_action[F3_TAP])
min_touches = 4;
else if (para->click_action[F2_CLICK1] || para->tap_action[F2_TAP] ||
@@ -3130,7 +3136,8 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
}
/* Post events */
- if (finger >= FS_TOUCHED && (dx || dy))
+ if (finger >= FS_TOUCHED && (dx || dy) &&
+ (para->touchpad_off != TOUCHPAD_CLICK_ONLY))
xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
if (priv->mid_emu_state == MBE_LEFT_CLICK) {