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

Setting relative mode default for bamboo was delayed only
because common->tablet_id wasn't available 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         |   14 +++++++++++---
 src/wcmValidateDevice.c |    8 --------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index b5d07f2..fbc8f04 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,14 @@ 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);
+       {
+               int flags = TOUCH_ID;
+
+               if (!(tablet_id >= 0xd0 && tablet_id <= 0xd3))
+                       flags |= ABSOLUTE_FLAG;
+
+               rc = wcmAllocate(local, XI_TOUCH, flags);
+       }
        else if (xf86NameCmp(type, "cursor") == 0)
                rc = wcmAllocate(local, XI_CURSOR, CURSOR_ID);
        else if (xf86NameCmp(type, "eraser") == 0)
@@ -358,7 +366,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


------------------------------------------------------------------------------
Download Intel&reg; 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