From: Chris Bagwell <ch...@cnpbagwell.com>

Setting relative mode default for bamboo was delayed only
because common->tablet_id wasn't avaliable early enough.
Now that its value is around, move setting default values to
single location.

Signed-off-by: Chris Bagwell <ch...@cnpbagwell.com>
---
 src/wcmConfig.c         |   12 +++++++++---
 src/wcmValidateDevice.c |    8 --------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index b5d07f2..20d2d7d 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -176,7 +176,8 @@ error:
        return 0;
 }
 
-static int wcmAllocateByType(LocalDevicePtr local, const char *type)
+static int wcmAllocateByType(LocalDevicePtr local, const char *type,
+                            int tablet_id)
 {
        int rc = 0;
 
@@ -191,7 +192,12 @@ static int wcmAllocateByType(LocalDevicePtr local, const 
char *type)
        if (xf86NameCmp(type, "stylus") == 0)
                rc = wcmAllocate(local, XI_STYLUS, ABSOLUTE_FLAG|STYLUS_ID);
        else if (xf86NameCmp(type, "touch") == 0)
-               rc = wcmAllocate(local, XI_TOUCH, ABSOLUTE_FLAG|TOUCH_ID);
+       {
+               if (tablet_id >= 0xd0 && tablet_id <= 0xd3)
+                       rc = wcmAllocate(local, XI_TOUCH, TOUCH_ID);
+               else
+                       rc = wcmAllocate(local, XI_TOUCH, 
ABSOLUTE_FLAG|TOUCH_ID);
+       }
        else if (xf86NameCmp(type, "cursor") == 0)
                rc = wcmAllocate(local, XI_CURSOR, CURSOR_ID);
        else if (xf86NameCmp(type, "eraser") == 0)
@@ -358,7 +364,7 @@ static LocalDevicePtr wcmInit(InputDriverPtr drv, IDevPtr 
dev, int flags)
                        goto SetupProc_fail;
        }
 
-       if (!wcmAllocateByType(local, type))
+       if (!wcmAllocateByType(local, type, tablet_id))
                goto SetupProc_fail;
 
        priv = (WacomDevicePtr) local->private;
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index 271f918..06291e8 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -453,15 +453,7 @@ int wcmParseOptions(LocalDevicePtr local, unsigned long* 
keys)
 
                /* If Mode not specified or is invalid then rely on
                 * Type specific defaults from initialization.
-                *
-                * If Mode default is hardware specific then handle here:
-                *
-                * touch Types are initilized to Absolute.
-                * Bamboo P&T touch pads need to change default to Relative.
                 */
-               if (IsTouch(priv) &&
-                   (common->tablet_id >= 0xd0) && (common->tablet_id <= 0xd3))
-                       priv->flags &= ~ABSOLUTE_FLAG;
        }
 
        /* Pad is always in relative mode when it's a core device.
-- 
1.6.6


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to