On Fri, Dec 11, 2009 at 02:11:34PM -0800, Ping wrote:
> > need to look at the code but I noticed here we check for that option twice,
> > once in wcmUSB.c, once in wcmValidateDevice. may be something to keep an
> > eye
> > on?
> >
> 
> The check is needed for both files.  In wcmValidateDevice.c, it is to
> initialize the value for all devices that are defined in xorg.conf.  Later
> on in wcmUSB.c (and wcmISDV4.c as well), they are reassigned due the
> possible changes in device specific features.
> 
> Let me know if this confuses you more.

it does, a bit anyway.
the device-specific features are the enabling of touch, etc. based on the
device's capabilities, right? (like the hunk below).

AIUI, these capabilities don't change during the runtime of a device. if so,
usbWcmInit is the wrong place to put the checks, it's called every time the
device is opened and that seems a bit excessive. (also, it looks like this
is the cause for the touch property being overwritten when you resume from
suspend :)

I think what we need here is something similar to the EvdevProbe() function
- a function that opens the device, checks the capabilities and sets the
required flags so that xf86WcmDevOpen and it's childs can be reduced to
little more than fd = open(device).

Cheers,
  Peter

> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 49cafc4..788bc88 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -550,6 +550,14 @@ Bool usbWcmInit(LocalDevicePtr local, char* id, float
> *version)
>               * For penabled TabletPCs. TabletPC is on by default */
>              common->wcmTPCButtonDefault = 1;
>          }
> +
> +        /* 2FG touch device */
> +        if (ISBITSET (keys, BTN_TOOL_TRIPLETAP))
> +        {
> +            /* GestureDefault was off for all devices
> +             * except when multi-touch is supported */
> +            common->wcmGestureDefault = 1;
> +        }
>      }
> 
>      if (!common->wcmModel)
> @@ -562,6 +570,10 @@ Bool usbWcmInit(LocalDevicePtr local, char* id, float
> *version)
>      common->wcmTouch = xf86SetBoolOption(local->options, "Touch",
>          common->wcmTouchDefault);
> 
> +    /* Touch gesture applies to the whole tablet */
> +    common->wcmGesture = xf86SetBoolOption(local->options, "Gesture",
> +        common->wcmGestureDefault);
> +
>      /* check if TPCButton was turned off in xorg.conf for pen */
>      if (priv->flags & STYLUS_ID)
>          common->wcmTPCButton = xf86SetBoolOption(local->options,


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to