We claim the pad is a relative device, but only because we had troubles with
the cursor landing at 0/0 in the past. Pretend we're still a relative
device, but post the values as absolute ones to the server.

Note that the device mode is to tell how the device _behaves_, it doesn't
specify how the device sends valuators. Thus, a relative device may only
post absolute coordinates and vice versa.

This applies to motion events only, button events for the scroll ring still
have the wrong valuator information.

Signed-off-by: Peter Hutterer <[email protected]>
---
 src/wcmCommon.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 79caffa..70ea9ed 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -670,25 +670,25 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
WacomDeviceState* ds)
                priv->oldButtons = 0;
        }
 
-       if (!is_absolute(pInfo))
+       if (type != PAD_ID)
        {
-               x -= priv->oldX;
-               y -= priv->oldY;
-               z -= priv->oldZ;
-               if (IsCursor(priv))
-               {
-                       v3 -= priv->oldRot;
-                       v4 -= priv->oldThrottle;
-               } else
+               if (!is_absolute(pInfo))
                {
-                       v3 -= priv->oldTiltX;
-                       v4 -= priv->oldTiltY;
+                       x -= priv->oldX;
+                       y -= priv->oldY;
+                       z -= priv->oldZ;
+                       if (IsCursor(priv))
+                       {
+                               v3 -= priv->oldRot;
+                               v4 -= priv->oldThrottle;
+                       } else
+                       {
+                               v3 -= priv->oldTiltX;
+                               v4 -= priv->oldTiltY;
+                       }
+                       v5 -= priv->oldWheel;
                }
-               v5 -= priv->oldWheel;
-       }
 
-       if (type != PAD_ID)
-       {
                /* coordinates are ready we can send events */
                if (is_proximity)
                {
@@ -756,7 +756,7 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
WacomDeviceState* ds)
                        /* xf86PostMotionEvent is only needed to post the 
valuators
                         * It should NOT move the cursor.
                         */
-                       xf86PostMotionEventP(pInfo->dev, is_absolute(pInfo), 3, 
3, valuators);
+                       xf86PostMotionEventP(pInfo->dev, TRUE, 3, 3, valuators);
                }
                else
                {
-- 
1.7.3.3


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to