summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2010-07-07 20:40:52 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2010-07-21 13:00:15 +1000
commit51e9bb815812469f39ad47f723d842bf1893a109 (patch)
tree681382e4dedca0b7c2b96bb4a04c9e9ef0c4df65
parentcc9d34155297a85fb214d76d4fc45f26cf41f5f3 (diff)
Expose pressure support in capabilities property.
Some properties are only valid when hardware supports pressure. For example, the *MinZ and *MaxZ options. Config GUI's may wish to disable/grey out config options related to pressure since not all hardware supports it. This will allow for that. Also, change setting of priv->has_pressure to boolean value so its value will always fit in 8-bit that properities report. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/eventcomm.c2
-rw-r--r--src/properties.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 60f737c..350a864 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -208,7 +208,7 @@ event_query_axis_ranges(LocalDevicePtr local)
priv->has_pressure = FALSE;
SYSCALL(rc = ioctl(local->fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits));
if (rc >= 0)
- priv->has_pressure = TEST_BIT(ABS_PRESSURE, absbits);
+ priv->has_pressure = (TEST_BIT(ABS_PRESSURE, absbits) != 0);
else
xf86Msg(X_ERROR, "%s: failed to query ABS bits (%s)\n", local->name,
strerror(errno));
diff --git a/src/properties.c b/src/properties.c
index e5eaf95..ab2a0eb 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -264,7 +264,8 @@ InitDeviceProperties(LocalDevicePtr local)
values[2] = priv->has_right;
values[3] = priv->has_double;
values[4] = priv->has_triple;
- prop_capabilities = InitAtom(local->dev, SYNAPTICS_PROP_CAPABILITIES, 8, 5, values);
+ values[5] = priv->has_pressure;
+ prop_capabilities = InitAtom(local->dev, SYNAPTICS_PROP_CAPABILITIES, 8, 6, values);
values[0] = para->resolution_vert;
values[1] = para->resolution_horiz;