[PATCH 06/18] Fix the check of Clickpad capabilities

Takashi Iwai tiwai at suse.de
Fri Oct 8 10:22:30 PDT 2010


Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 src/eventcomm.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 8a77788..517e6c3 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -169,6 +169,25 @@ event_query_info(InputInfoPtr pInfo)
 }
 
 static void
+event_query_clickpad(LocalDevicePtr local)
+{
+    SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
+
+    /* clickpad device reports only the single left button mask */
+    if (priv->has_left && !priv->has_right && !priv->has_middle &&
+	!priv->has_double &&
+	priv->model == MODEL_SYNAPTICS) {
+	priv->is_clickpad = TRUE;
+	/* enable right/middle button caps; otherwise gnome-settings-daemon
+	 * will ignore this device for left/right-hand setup because of a
+	 * single-button
+	 */
+	priv->has_right = priv->has_middle = TRUE;
+	xf86Msg(X_INFO, "%s: is Clickpad device\n", local->name);
+    }
+}
+
+static void
 event_query_led(LocalDevicePtr local)
 {
     SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
@@ -297,12 +316,6 @@ event_query_axis_ranges(InputInfoPtr pInfo)
 	}
 
 	xf86Msg(X_PROBED, "%s: buttons:%s\n", pInfo->name, buf);
-
-	/* clickpad device reports only the single left button mask */
-	if (priv->has_left && !priv->has_right && !priv->has_middle && !priv->has_double) {
-	    priv->is_clickpad = TRUE;
-	    xf86Msg(X_PROBED, "%s: is Clickpad device\n", local->name);
-	}
     }
 }
 
@@ -462,6 +475,7 @@ EventReadDevDimensions(InputInfoPtr pInfo)
     if (event_query_is_touchpad(pInfo->fd, (need_grab) ? *need_grab : TRUE))
 	event_query_axis_ranges(pInfo);
     event_query_info(pInfo);
+    event_query_clickpad(local);
     event_query_led(local);
 }
 
-- 
1.7.3.1



More information about the xorg-devel mailing list