The driver doesn't really know anymore whether a device is a core device or
not since it may change at any time after an XIChangeHierarchy() call. Even
then, a device is never a core device anyway - the master device it is
attached to is.

This code can't be triggered in server 1.7 or higher anyway, just purge it
and return an error when trying to set the pad to relative mode.

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 man/wacom.man           |    6 ++----
 src/wcmValidateDevice.c |    6 ++----
 src/wcmXCommand.c       |   30 ++----------------------------
 src/xf86Wacom.h         |    3 ---
 4 files changed, 6 insertions(+), 39 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index 4690758..bc16b0e 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -93,10 +93,8 @@ to or greater than suppress (if tilt is supported);
         proximity has changed.
 .TP 4
 .B Option \fI"Mode"\fP \fI"Relative"|"Absolute"\fP
-sets the mode of the device.  The default value for stylus and 
-eraser is Absolute; cursor is Relative; pad mode is decided 
-according to its core option due to its nature of not moving 
-system cursor: Relative if it is a core device; Absolute, otherwise;
+sets the mode of the device.  The default value for stylus, pad and
+eraser is Absolute; cursor is Relative;
 touch defaults to Relative for tablets with touch pads and Absolute for
 touch screens.
 .TP 4
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index a81a9b1..918e4f4 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -447,11 +447,9 @@ int wcmParseOptions(LocalDevicePtr local, unsigned long* 
keys)
                 */
        }
 
-       /* Pad is always in relative mode when it's a core device.
-        * Always in absolute mode when it is not a core device.
-        */
+       /* Pad is always in absolute mode. */
        if (IsPad(priv))
-               wcmSetPadCoreMode(local);
+               priv->flags |= ABSOLUTE_FLAG;
 
        /* Store original local Core flag so it can be changed later */
        if (local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER))
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index 0a1c8e9..4ddddff 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -26,30 +26,6 @@
 #include <exevents.h>
 
 /*****************************************************************************
- * wcmSetPadCoreMode
- ****************************************************************************/
-
-int wcmSetPadCoreMode(LocalDevicePtr local)
-{
-       WacomDevicePtr priv = (WacomDevicePtr)local->private;
-       int is_core = local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER);
-
-       /* Pad is always in relative mode when it's a core device.
-        * Always in absolute mode when it is not a core device.
-        */
-       DBG(10, priv, "%p"
-               " is always in %s mode when it %s core device\n",
-               (void *)local->dev, 
-               !is_core ? "absolute" : "relative", 
-               is_core ? "is" : "isn't");
-       if (is_core)
-               priv->flags &= ~ABSOLUTE_FLAG;
-       else
-               priv->flags |= ABSOLUTE_FLAG;
-       return Success;
-}
-
-/*****************************************************************************
 * wcmDevSwitchModeCall --
 *****************************************************************************/
 
@@ -60,11 +36,9 @@ int wcmDevSwitchModeCall(LocalDevicePtr local, int mode)
 
        DBG(3, priv, "to mode=%d\n", mode);
 
-       /* Pad is always in relative mode when it's a core device.
-        * Always in absolute mode when it is not a core device.
-        */
+       /* Pad is always in absolute mode.*/
        if (IsPad(priv))
-               return wcmSetPadCoreMode(local);
+               return (mode == Absolute) ? Success : XI_BadMode;
 
        if ((mode == Absolute) && !is_absolute)
        {
diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
index cc85e57..802ea9e 100644
--- a/src/xf86Wacom.h
+++ b/src/xf86Wacom.h
@@ -144,9 +144,6 @@ void wcmSendEvents(LocalDevicePtr local, const 
WacomDeviceState* ds);
 Bool wcmPointInArea(WacomToolAreaPtr area, int x, int y);
 Bool wcmAreaListOverlap(WacomToolAreaPtr area, WacomToolAreaPtr list);
 
-/* Change pad's mode according to it core event status */
-int wcmSetPadCoreMode(LocalDevicePtr local);
-
 /* calculate the proper tablet to screen mapping factor */
 void wcmMappingFactor(LocalDevicePtr local);
 
-- 
1.6.6.1


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to