summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2010-07-19 19:30:14 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2010-07-21 13:08:46 +1000
commit75459b1c0bb85ce0bbeb4270114edddb30ff3b1b (patch)
tree9e353b310bc4dbdd4c75aa1c38a05747d3a069cd
parent51e9bb815812469f39ad47f723d842bf1893a109 (diff)
Expose width support in capabilites properity.
Some properties are only valid with hardware supports width. Namely, *MinW properties. Config GUI's may wish to disable/grey out options related to width support. This combined with pressure property is good indication when 2 finger scrolling can be supported using emulation. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/eventcomm.c19
-rw-r--r--src/properties.c3
-rw-r--r--src/synapticsstr.h1
3 files changed, 16 insertions, 7 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 350a864..faa66ab 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -206,9 +206,13 @@ event_query_axis_ranges(LocalDevicePtr local)
strerror(errno));
priv->has_pressure = FALSE;
+ priv->has_width = FALSE;
SYSCALL(rc = ioctl(local->fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits));
if (rc >= 0)
+ {
priv->has_pressure = (TEST_BIT(ABS_PRESSURE, absbits) != 0);
+ priv->has_width = (TEST_BIT(ABS_TOOL_WIDTH, absbits) != 0);
+ }
else
xf86Msg(X_ERROR, "%s: failed to query ABS bits (%s)\n", local->name,
strerror(errno));
@@ -228,13 +232,16 @@ event_query_axis_ranges(LocalDevicePtr local)
"%s: device does not report pressure, will use touch data.\n",
local->name);
- SYSCALL(rc = ioctl(local->fd, EVIOCGABS(ABS_TOOL_WIDTH), &abs));
- if (rc >= 0)
+ if (priv->has_width)
{
- xf86Msg(X_PROBED, "%s: finger width range %d - %d\n", local->name,
- abs.minimum, abs.maximum);
- priv->minw = abs.minimum;
- priv->maxw = abs.maximum;
+ SYSCALL(rc = ioctl(local->fd, EVIOCGABS(ABS_TOOL_WIDTH), &abs));
+ if (rc >= 0)
+ {
+ xf86Msg(X_PROBED, "%s: finger width range %d - %d\n", local->name,
+ abs.minimum, abs.maximum);
+ priv->minw = abs.minimum;
+ priv->maxw = abs.maximum;
+ }
}
SYSCALL(rc = ioctl(local->fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits));
diff --git a/src/properties.c b/src/properties.c
index ab2a0eb..b17089c 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -265,7 +265,8 @@ InitDeviceProperties(LocalDevicePtr local)
values[3] = priv->has_double;
values[4] = priv->has_triple;
values[5] = priv->has_pressure;
- prop_capabilities = InitAtom(local->dev, SYNAPTICS_PROP_CAPABILITIES, 8, 6, values);
+ values[6] = priv->has_width;
+ prop_capabilities = InitAtom(local->dev, SYNAPTICS_PROP_CAPABILITIES, 8, 7, values);
values[0] = para->resolution_vert;
values[1] = para->resolution_horiz;
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 75c3ec8..b4a72aa 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -231,6 +231,7 @@ typedef struct _SynapticsPrivateRec
Bool has_double; /* double click detected for this device */
Bool has_triple; /* triple click detected for this device */
Bool has_pressure; /* device reports pressure */
+ Bool has_width; /* device reports finger width */
Bool has_scrollbuttons; /* device has physical scrollbuttons */
enum TouchpadModel model; /* The detected model */