Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 src/wcmCommon.c         |    8 ++++----
 src/wcmValidateDevice.c |    2 +-
 src/xf86WacomDefs.h     |    2 ++
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 516d57c..352ec9e 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -890,7 +890,7 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel,
        }
 
        /* Discard the first 2 USB packages due to events delay */
-       if ( (pChannel->nSamples < 2) && (common->wcmDevCls == 
&gWacomUSBDevice) && 
+       if ( (pChannel->nSamples < 2) && IsUSBDevice(common) &&
                ds.device_type != PAD_ID && (ds.device_type != TOUCH_ID) )
        {
                DBG(11, common,
@@ -1142,18 +1142,18 @@ static void commonDispatchDevice(WacomCommonPtr common, 
unsigned int channel,
        button = 1;
        priv = pDev->private;
 
-       if (common->wcmDevCls == &gWacomUSBDevice && IsTouch(priv) && 
!ds->proximity)
+       if (IsUSBDevice(common) && IsTouch(priv) && !ds->proximity)
        {
                priv->hardProx = 0;
        }
 
-       if (common->wcmDevCls == &gWacomUSBDevice && (IsStylus(priv) || 
IsEraser(priv)))
+       if (IsUSBDevice(common) && (IsStylus(priv) || IsEraser(priv)))
        {
                priv->hardProx = 1;
        }
 
        /* send a touch out for USB Tablet PCs */
-       if (common->wcmDevCls == &gWacomUSBDevice && !IsTouch(priv)
+       if (IsUSBDevice(common) && !IsTouch(priv)
                        && common->wcmTouchDefault && !priv->oldProximity)
        {
                InputInfoPtr device = xf86FirstLocalDevice();
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index bd594fb..29eb642 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -698,7 +698,7 @@ int wcmParseOptions(InputInfoPtr pInfo, int hotplugged)
                                "be set by a touch tool.\n", pInfo->name);
 
                /* FIXME: wtf is this here?? */
-               if ((common->wcmDevCls == &gWacomUSBDevice) &&
+               if (IsUSBDevice(common) &&
                                TabletHasFeature(common, WCM_LCD) &&
                                TabletHasFeature(common, WCM_2FGT)) {
                        common->wcmGestureParameters.wcmZoomDistanceDefault = 
30;
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index aae1b56..3a680d1 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -186,6 +186,8 @@ struct _WacomModel
 #define IsEraser(priv) (DEVICE_ID((priv)->flags) == ERASER_ID)
 #define IsPad(priv)    (DEVICE_ID((priv)->flags) == PAD_ID)
 
+#define IsUSBDevice(common) ((common)->wcmDevCls == &gWacomUSBDevice)
+
 #define FILTER_PRESSURE_RES    2048    /* maximum points in pressure curve */
 #define WCM_MAX_BUTTONS                32      /* maximum number of tablet 
buttons */
 #define WCM_MAX_MOUSE_BUTTONS  16      /* maximum number of buttons-on-pointer
-- 
1.7.3.4

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to