summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wcmCommon.c4
-rw-r--r--src/wcmXCommand.c8
-rw-r--r--src/xf86WacomDefs.h4
3 files changed, 9 insertions, 7 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 0f041e3..11340ea 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -28,10 +28,6 @@
#include <xkbsrv.h>
#include <xf86_OSproc.h>
-/* Tested result for setting the pressure threshold to a reasonable value */
-#define THRESHOLD_TOLERANCE (FILTER_PRESSURE_RES / 125)
-#define DEFAULT_THRESHOLD (FILTER_PRESSURE_RES / 75)
-
/* X servers pre 1.9 didn't copy data passed into xf86Post*Event.
* Data passed in would be modified, requiring the driver to copy the
* data beforehand.
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index 40393dc..6613a59 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -755,14 +755,16 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
common->wcmCursorProxoutDist = value;
} else if (property == prop_threshold)
{
- CARD32 value;
+ INT32 value;
if (prop->size != 1 || prop->format != 32)
return BadValue;
- value = *(CARD32*)prop->data;
+ value = *(INT32*)prop->data;
- if ((value < 1) || (value > FILTER_PRESSURE_RES))
+ if (value == -1)
+ value = DEFAULT_THRESHOLD;
+ else if ((value < 1) || (value > FILTER_PRESSURE_RES))
return BadValue;
if (!checkonly)
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 2f3f7b4..3b79189 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -183,6 +183,10 @@ struct _WacomModel
#define IsUSBDevice(common) ((common)->wcmDevCls == &gWacomUSBDevice)
#define FILTER_PRESSURE_RES 2048 /* maximum points in pressure curve */
+/* Tested result for setting the pressure threshold to a reasonable value */
+#define THRESHOLD_TOLERANCE (FILTER_PRESSURE_RES / 125)
+#define DEFAULT_THRESHOLD (FILTER_PRESSURE_RES / 75)
+
#define WCM_MAX_BUTTONS 32 /* maximum number of tablet buttons */
#define WCM_MAX_MOUSE_BUTTONS 16 /* maximum number of buttons-on-pointer
* (which are treated as mouse buttons,