[PATCH synaptics v2 04/21] Fix pressure->motion property format

Daniel Stone daniel at fooishbar.org
Tue Jun 14 10:05:52 PDT 2011


From: Derek Foreman <derek.foreman at collabora.co.uk>

UINT32, not float.

Signed-off-by: Derek Foreman <derek.foreman at collabora.co.uk>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
---
 src/properties.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

v2: Use the new InitTypedAtom, and actually use CARD32 rather than INT32.

diff --git a/src/properties.c b/src/properties.c
index f5f78e3..5f11cf2 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -266,7 +266,7 @@ InitDeviceProperties(InputInfoPtr pInfo)
 
     values[0] = para->press_motion_min_z;
     values[1] = para->press_motion_max_z;
-    prop_pressuremotion = InitAtom(pInfo->dev, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 2, values);
+    prop_pressuremotion = InitTypedAtom(pInfo->dev, SYNAPTICS_PROP_PRESSURE_MOTION, XA_CARDINAL, 32, 2, values);
 
     fvalues[0] = para->press_motion_min_factor;
     fvalues[1] = para->press_motion_max_factor;
@@ -652,11 +652,11 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
         para->coasting_friction = coast_speeds[1];
     } else if (property == prop_pressuremotion)
     {
-        float *press;
-        if (prop->size != 2 || prop->format != 32 || prop->type != float_type)
+        CARD32 *press;
+        if (prop->size != 2 || prop->format != 32 || prop->type != XA_CARDINAL)
             return BadMatch;
 
-        press = (float*)prop->data;
+        press = (CARD32*)prop->data;
         if (press[0] > press[1])
             return BadValue;
 
-- 
1.7.5.3



More information about the xorg-devel mailing list