[PATCH xf86-input-synaptics v3 07/10] Calculate touch data for semi-mt devices, but don't send touch events

Chase Douglas chase.douglas at canonical.com
Thu Feb 23 13:02:22 PST 2012


Previously, all touch data from semi-mt devices was ignored because the
X server doesn't support them. However, the touch data must be used for
proper clickpad handling.

Instead of ignoring semi-mt device touch events, mark the device as
being semi-mt and allow initialization of the touch state. The touches
will then be used in calculating the cumulative_d{x,y} values that are
needed for clickpad support.

When handling the touch data for X event processing, simply skip over
reporting the touches.

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 src/eventcomm.c    |    2 +-
 src/synaptics.c    |    3 +++
 src/synapticsstr.h |    1 +
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index a1f334b..92f99a9 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -759,7 +759,7 @@ event_query_touch(InputInfoPtr pInfo)
     {
         xf86IDrvMsg(pInfo, X_INFO,
                     "ignoring touch events for semi-multitouch device\n");
-        return;
+        priv->has_semi_mt = TRUE;
     }
 
     if (rc >= 0 && BitIsOn(&prop, INPUT_PROP_BUTTONPAD))
diff --git a/src/synaptics.c b/src/synaptics.c
index 58fc02c..05ea6b9 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2691,6 +2691,9 @@ HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw)
             new_active_touches--;
     }
 
+    if (priv->has_semi_mt)
+        goto out;
+
     if (priv->num_active_touches < min_touches &&
         new_active_touches < min_touches)
     {
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index bdea96a..944fd6b 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -267,6 +267,7 @@ typedef struct _SynapticsPrivateRec
     Bool has_pressure;			/* device reports pressure */
     Bool has_width;			/* device reports finger width */
     Bool has_scrollbuttons;		/* device has physical scrollbuttons */
+    Bool has_semi_mt;			/* device is only semi-multitouch capable */
 
     enum TouchpadModel model;		/* The detected model */
     unsigned short id_vendor;		/* vendor id */
-- 
1.7.9



More information about the xorg-devel mailing list