On Thursday, October 3, 2013, Peter Hutterer wrote:
> On Thu, Oct 03, 2013 at 05:18:41PM -0700, Ping Cheng wrote:
> > kernel 3.7 introduced INPUT_PROP_DIRECT to indicate a device is
> > a direct touch (onscreen pointer) device. Use it so we do not
> > have to add individual devcies for that feature.
> >
> > Signed-off-by: Ping Cheng <pi...@wacom.com <javascript:;>>
> > ---
> > src/wcmValidateDevice.c | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> > index 1a5e722..5d89a94 100644
> > --- a/src/wcmValidateDevice.c
> > +++ b/src/wcmValidateDevice.c
> > @@ -26,6 +26,14 @@
> > #include <fcntl.h>
> > #include <unistd.h>
> >
> > +#ifndef INPUT_PROP_DIRECT
> > +#define INPUT_PROP_DIRECT 0x01
> > +#endif
> > +
> > +#ifndef INPUT_PROP_MAX
> > +#define INPUT_PROP_MAX 0x1f
> > +#endif
> > +
> > /* wcmCheckSource - Check if there is another source defined this device
> > * before or not: don't add the tool by hal/udev if user has defined at
> least
> > * one tool for the device in xorg.conf. One device can have multiple
> tools
> > @@ -192,6 +200,7 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
> > int ret = 1;
> > WacomDevicePtr priv = pInfo->private;
> > WacomCommonPtr common = priv->common;
> > + unsigned long prop[NBITS(INPUT_PROP_MAX)] = {0};
> >
> > priv->common->tablet_id = common->wcmDevCls->ProbeKeys(pInfo);
> >
> > @@ -308,6 +317,10 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
> > break;
> > }
> >
> > + ioctl(pInfo->fd, EVIOCGPROP(sizeof(prop)), prop);
> > + if (ISBITSET(prop, INPUT_PROP_DIRECT))
> > + TabletSetFeature(priv->common, WCM_LCD);
> > +
>
>
> you'll need to wrap this in ifdefs, EVIOCGPROP isn't defined if
> INPUT_PROP_DIRECT isn't defined.
Oops. I knew someone will catch that bug :-).
Maybe we should not call EVIOCGPROP if INPUT_PROP_DIRECT is undefined? But,
I know you do not like ifdef insider the code.
Do you need me to make a new patch for you?
Ping
>
> Cheers,
> Peter
>
> > if (ISBITSET(common->wcmKeys, BTN_TOOL_PEN))
> > TabletSetFeature(priv->common, WCM_PEN);
> >
> > --
> > 1.8.1.2
> >
>
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel