Re: [Linuxwacom-devel] [xf86-input-wacom PATCH 3/4] Post maximum number of contacts to clients

2012-12-03 Thread Ping Cheng
On Monday, December 3, 2012, Peter Hutterer wrote:

> On Mon, Dec 03, 2012 at 08:35:42PM -0800, Ping Cheng wrote:
> > On Monday, December 3, 2012, Peter Hutterer wrote:
> >
> > > On Wed, Nov 21, 2012 at 12:14:53PM -0800, Ping Cheng wrote:
> > > > Clients should know the maximum number of contacts a touch device
> > > > support before they get touch events.
> > > >
> > > > Signed-off-by: Ping Cheng >
> > > >
> > > > ---
> > > > The following TO-Do takes more time than I have now. I list it
> > > > here so we do not forget them.
> > > >
> > > > X server supports pointer emulation for touch device. We should
> > > > let X server take care of single touch events for both MT and
> > > > single touch devices that are running on newer servers;
> > > >
> > > > Touch events are currently all posted in relative mode (touchpad).
> > > > We need to support absolute mode (touchscreen) devices.
> > > > ---
> > > >  src/wcmUSB.c|3 +++
> > > >  src/xf86Wacom.c |6 +-
> > > >  src/xf86WacomDefs.h |1 +
> > > >  3 files changed, 9 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> > > > index 5cc7830..acce5ee 100644
> > > > --- a/src/wcmUSB.c
> > > > +++ b/src/wcmUSB.c
> > > > @@ -681,6 +681,9 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
> > > >   {
> > > >   private->wcmUseMT = 1;
> > > >
> > > > + if (!ioctl(pInfo->fd, EVIOCGABS(ABS_MT_SLOT),
> &absinfo))
> > > > + common->wcmMaxContacts = absinfo.maximum + 1;
> > > > +
> > > >   /* pen and MT on the same logical port */
> > > >   if (ISBITSET(common->wcmKeys, BTN_TOOL_PEN))
> > > >   private->wcmPenTouch = TRUE;
> > > > diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
> > > > index bb11cf4..808f5f8 100644
> > > > --- a/src/xf86Wacom.c
> > > > +++ b/src/xf86Wacom.c
> > > > @@ -323,6 +323,7 @@ static int wcmDevInit(DeviceIntPtr pWcm)
> > > >  {
> > > >   InputInfoPtr pInfo = (InputInfoPtr)pWcm->public.devicePrivate;
> > > >   WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
> > > > + WacomCommonPtr common = priv->common;
> > > >   unsigned char butmap[WCM_MAX_BUTTONS+1];
> > > >   int nbaxes, nbbuttons, nbkeys;
> > > >   int loop;
> > > > @@ -421,7 +422,10 @@ static int wcmDevInit(DeviceIntPtr pWcm)
> > > >
> > > >  #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 16
> > > >   if (IsTouch(priv)) {
> > > > - if (!InitTouchClassDeviceStruct(pInfo->dev, 0,
> > > XIDependentTouch, 2)) {
> > > > + if (!common->wcmMaxContacts)
> > > > + common->wcmMaxContacts = 1;
> > >
> > > a default of 0 means "don't know", and we should leave it at that.
> >
> >
> > That is true if we have no idea how many contacts we are going to have.
> > However, when we are inside IsTouch(), we know for sure we have at least
> > one contact. The actual number of contacts will be updated later.
> >
> > Do we still need to leave it at 0?
>
> yes, there is currently no facility in the server to update it later. and
> "at least one" is the same as "don't know" because one would assume that
> any
> touch device has at least one - otherwise it'd be a mouse :)


With your comments, I need to look into the code again. The value should
have been decided before we come to this point. My if-statement meant to be
a safeguard, which is obviously not at the right place.

0 signals to the client that the device doesn't know how many concurrent
> touches this device supports, so they should prepare for the best/worst.
> setting it to 1 but then sending more than one touchpoint is more likely to
> confuse the client.


Makes perfect sense! Thank you for your time.

Ping


> Cheers,
>Peter
>
>
> > > > +
> > > > + if (!InitTouchClassDeviceStruct(pInfo->dev,
> > > common->wcmMaxContacts, XIDependentTouch, 2)) {
> > > >   xf86Msg(X_ERROR, "Unable to init touch class
> > > device struct!\n");
> > > >   return FALSE;
> > > >   }
> > > > diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> > > > index 7df0e95..abfde70 100644
> > > > --- a/src/xf86WacomDefs.h
> > > > +++ b/src/xf86WacomDefs.h
> > > > @@ -446,6 +446,7 @@ struct _WacomCommonRec
> > > >/* tablet Z resolution is
> equivalent
> > > > * to wcmMaxZ which is equal to
> 100%
> > > pressure */
> > > >   int wcmMaxDist;  /* tablet max distance value */
> > > > + int wcmMaxContacts;  /* MT device max number of
> contacts */
> > > >
> > > >   /*
> > > >* TODO Remove wcmTiltOff*, once the kernel drivers reporting
> > > > --
> > > > 1.7.10.4
> > >
>
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficien

Re: [Linuxwacom-devel] [xf86-input-wacom PATCH 4/4] Update resoltuion for old kernels

2012-12-03 Thread Ping Cheng
On Monday, December 3, 2012, Peter Hutterer wrote:

> On Tue, Dec 04, 2012 at 01:22:25PM +1000, Peter Hutterer wrote:
> > On Wed, Nov 21, 2012 at 12:15:22PM -0800, Ping Cheng wrote:
> > > We upscaled the resolutions in WacomModelDesc and for absinfos that
> > > support resolution. But we forgot to update them for older kernels
> > > that do not support resolution in absinfo.
> >
> > help my memory - when did we upscale the resolution?
>
> ok, nevermind, I found that bit


Thank you for your prompt reply. I didn't expect an action so fast. A
random "scream" does draw attention. I know how to use this trick next time
;).



> > > Signed-off-by: Ping Cheng >
> > > ---
> > >  src/wcmUSB.c |6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> > > index acce5ee..418ccbc 100644
> > > --- a/src/wcmUSB.c
> > > +++ b/src/wcmUSB.c
> > > @@ -331,7 +331,7 @@ static struct
> > > { NTRIG_VENDOR_ID,  0x01, 44173, 36772, &usbTabletPC},
> > >
> > > /* Add in Lenovo W700 Palmrest digitizer */
> > > -   { LENOVO_VENDOR_ID, 0x6004, 2540, 2540, &usbTabletPC   } /*
> Pen-only */
> > > +   { LENOVO_VENDOR_ID, 0x6004, 10, 10, &usbTabletPC   } /*
> Pen-only */
>
> this isn't upscaling, this is just using the right units (units/m instead
> of
> units/inch)
>
> ack to the two changes, but they need to be two patches - one to update the
> W700, one to update the resolution into the right range.


Boy, you know how to use your power to make me work, don't you ;)?


> Plus a commit
> message that mentions that the source data is hundredths of a mm, I had to
> go check the source to understand why we're using 10 here.


Yes, sir! Patches to follow, tomorrow.

Ping


>
> Cheers,
>Peter
>
> > >  };
> > >
> > >  static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version)
> > > @@ -572,7 +572,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
> > > {
> > > if (is_touch)
> > > common->wcmTouchResolX =
> > > -   (int)(((double)common->wcmMaxTouchX * 10.0
> > > +   (int)(((double)common->wcmMaxTouchX *
> 10.0
> > >  / (double)absinfo.maximum) + 0.5);
> > > else
> > > common->wcmMaxStripX = absinfo.maximum;
> > > @@ -661,7 +661,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
> > > {
> > > if (is_touch)
> > > common->wcmTouchResolY =
> > > -(int)(((double)common->wcmMaxTouchY * 10.0
> > > +(int)(((double)common->wcmMaxTouchY *
> 10.0
> > >  / (double)absinfo.maximum) + 0.5);
> > > else
> > > common->wcmMaxStripY = absinfo.maximum;
> > > --
> > > 1.7.10.4
>
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [xf86-input-wacom PATCH 3/4] Post maximum number of contacts to clients

2012-12-03 Thread Peter Hutterer
On Mon, Dec 03, 2012 at 08:35:42PM -0800, Ping Cheng wrote:
> On Monday, December 3, 2012, Peter Hutterer wrote:
> 
> > On Wed, Nov 21, 2012 at 12:14:53PM -0800, Ping Cheng wrote:
> > > Clients should know the maximum number of contacts a touch device
> > > support before they get touch events.
> > >
> > > Signed-off-by: Ping Cheng >
> > >
> > > ---
> > > The following TO-Do takes more time than I have now. I list it
> > > here so we do not forget them.
> > >
> > > X server supports pointer emulation for touch device. We should
> > > let X server take care of single touch events for both MT and
> > > single touch devices that are running on newer servers;
> > >
> > > Touch events are currently all posted in relative mode (touchpad).
> > > We need to support absolute mode (touchscreen) devices.
> > > ---
> > >  src/wcmUSB.c|3 +++
> > >  src/xf86Wacom.c |6 +-
> > >  src/xf86WacomDefs.h |1 +
> > >  3 files changed, 9 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> > > index 5cc7830..acce5ee 100644
> > > --- a/src/wcmUSB.c
> > > +++ b/src/wcmUSB.c
> > > @@ -681,6 +681,9 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
> > >   {
> > >   private->wcmUseMT = 1;
> > >
> > > + if (!ioctl(pInfo->fd, EVIOCGABS(ABS_MT_SLOT), &absinfo))
> > > + common->wcmMaxContacts = absinfo.maximum + 1;
> > > +
> > >   /* pen and MT on the same logical port */
> > >   if (ISBITSET(common->wcmKeys, BTN_TOOL_PEN))
> > >   private->wcmPenTouch = TRUE;
> > > diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
> > > index bb11cf4..808f5f8 100644
> > > --- a/src/xf86Wacom.c
> > > +++ b/src/xf86Wacom.c
> > > @@ -323,6 +323,7 @@ static int wcmDevInit(DeviceIntPtr pWcm)
> > >  {
> > >   InputInfoPtr pInfo = (InputInfoPtr)pWcm->public.devicePrivate;
> > >   WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
> > > + WacomCommonPtr common = priv->common;
> > >   unsigned char butmap[WCM_MAX_BUTTONS+1];
> > >   int nbaxes, nbbuttons, nbkeys;
> > >   int loop;
> > > @@ -421,7 +422,10 @@ static int wcmDevInit(DeviceIntPtr pWcm)
> > >
> > >  #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 16
> > >   if (IsTouch(priv)) {
> > > - if (!InitTouchClassDeviceStruct(pInfo->dev, 0,
> > XIDependentTouch, 2)) {
> > > + if (!common->wcmMaxContacts)
> > > + common->wcmMaxContacts = 1;
> >
> > a default of 0 means "don't know", and we should leave it at that.
> 
> 
> That is true if we have no idea how many contacts we are going to have.
> However, when we are inside IsTouch(), we know for sure we have at least
> one contact. The actual number of contacts will be updated later.
> 
> Do we still need to leave it at 0?

yes, there is currently no facility in the server to update it later. and
"at least one" is the same as "don't know" because one would assume that any
touch device has at least one - otherwise it'd be a mouse :)

0 signals to the client that the device doesn't know how many concurrent
touches this device supports, so they should prepare for the best/worst.
setting it to 1 but then sending more than one touchpoint is more likely to
confuse the client.

Cheers,
   Peter


> > > +
> > > + if (!InitTouchClassDeviceStruct(pInfo->dev,
> > common->wcmMaxContacts, XIDependentTouch, 2)) {
> > >   xf86Msg(X_ERROR, "Unable to init touch class
> > device struct!\n");
> > >   return FALSE;
> > >   }
> > > diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> > > index 7df0e95..abfde70 100644
> > > --- a/src/xf86WacomDefs.h
> > > +++ b/src/xf86WacomDefs.h
> > > @@ -446,6 +446,7 @@ struct _WacomCommonRec
> > >/* tablet Z resolution is equivalent
> > > * to wcmMaxZ which is equal to 100%
> > pressure */
> > >   int wcmMaxDist;  /* tablet max distance value */
> > > + int wcmMaxContacts;  /* MT device max number of contacts */
> > >
> > >   /*
> > >* TODO Remove wcmTiltOff*, once the kernel drivers reporting
> > > --
> > > 1.7.10.4
> >

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [xf86-input-wacom PATCH 3/4] Post maximum number of contacts to clients

2012-12-03 Thread Ping Cheng
On Monday, December 3, 2012, Peter Hutterer wrote:

> On Wed, Nov 21, 2012 at 12:14:53PM -0800, Ping Cheng wrote:
> > Clients should know the maximum number of contacts a touch device
> > support before they get touch events.
> >
> > Signed-off-by: Ping Cheng >
> >
> > ---
> > The following TO-Do takes more time than I have now. I list it
> > here so we do not forget them.
> >
> > X server supports pointer emulation for touch device. We should
> > let X server take care of single touch events for both MT and
> > single touch devices that are running on newer servers;
> >
> > Touch events are currently all posted in relative mode (touchpad).
> > We need to support absolute mode (touchscreen) devices.
> > ---
> >  src/wcmUSB.c|3 +++
> >  src/xf86Wacom.c |6 +-
> >  src/xf86WacomDefs.h |1 +
> >  3 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> > index 5cc7830..acce5ee 100644
> > --- a/src/wcmUSB.c
> > +++ b/src/wcmUSB.c
> > @@ -681,6 +681,9 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
> >   {
> >   private->wcmUseMT = 1;
> >
> > + if (!ioctl(pInfo->fd, EVIOCGABS(ABS_MT_SLOT), &absinfo))
> > + common->wcmMaxContacts = absinfo.maximum + 1;
> > +
> >   /* pen and MT on the same logical port */
> >   if (ISBITSET(common->wcmKeys, BTN_TOOL_PEN))
> >   private->wcmPenTouch = TRUE;
> > diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
> > index bb11cf4..808f5f8 100644
> > --- a/src/xf86Wacom.c
> > +++ b/src/xf86Wacom.c
> > @@ -323,6 +323,7 @@ static int wcmDevInit(DeviceIntPtr pWcm)
> >  {
> >   InputInfoPtr pInfo = (InputInfoPtr)pWcm->public.devicePrivate;
> >   WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
> > + WacomCommonPtr common = priv->common;
> >   unsigned char butmap[WCM_MAX_BUTTONS+1];
> >   int nbaxes, nbbuttons, nbkeys;
> >   int loop;
> > @@ -421,7 +422,10 @@ static int wcmDevInit(DeviceIntPtr pWcm)
> >
> >  #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 16
> >   if (IsTouch(priv)) {
> > - if (!InitTouchClassDeviceStruct(pInfo->dev, 0,
> XIDependentTouch, 2)) {
> > + if (!common->wcmMaxContacts)
> > + common->wcmMaxContacts = 1;
>
> a default of 0 means "don't know", and we should leave it at that.


That is true if we have no idea how many contacts we are going to have.
However, when we are inside IsTouch(), we know for sure we have at least
one contact. The actual number of contacts will be updated later.

Do we still need to leave it at 0?

 Ping


> Cheers,
>Peter
>
> > +
> > + if (!InitTouchClassDeviceStruct(pInfo->dev,
> common->wcmMaxContacts, XIDependentTouch, 2)) {
> >   xf86Msg(X_ERROR, "Unable to init touch class
> device struct!\n");
> >   return FALSE;
> >   }
> > diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> > index 7df0e95..abfde70 100644
> > --- a/src/xf86WacomDefs.h
> > +++ b/src/xf86WacomDefs.h
> > @@ -446,6 +446,7 @@ struct _WacomCommonRec
> >/* tablet Z resolution is equivalent
> > * to wcmMaxZ which is equal to 100%
> pressure */
> >   int wcmMaxDist;  /* tablet max distance value */
> > + int wcmMaxContacts;  /* MT device max number of contacts */
> >
> >   /*
> >* TODO Remove wcmTiltOff*, once the kernel drivers reporting
> > --
> > 1.7.10.4
>
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [xf86-input-wacom PATCH 4/4] Update resoltuion for old kernels

2012-12-03 Thread Peter Hutterer
On Tue, Dec 04, 2012 at 01:22:25PM +1000, Peter Hutterer wrote:
> On Wed, Nov 21, 2012 at 12:15:22PM -0800, Ping Cheng wrote:
> > We upscaled the resolutions in WacomModelDesc and for absinfos that
> > support resolution. But we forgot to update them for older kernels
> > that do not support resolution in absinfo.
> 
> help my memory - when did we upscale the resolution?

ok, nevermind, I found that bit

> > Signed-off-by: Ping Cheng 
> > ---
> >  src/wcmUSB.c |6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> > index acce5ee..418ccbc 100644
> > --- a/src/wcmUSB.c
> > +++ b/src/wcmUSB.c
> > @@ -331,7 +331,7 @@ static struct
> > { NTRIG_VENDOR_ID,  0x01, 44173, 36772, &usbTabletPC},
> >  
> > /* Add in Lenovo W700 Palmrest digitizer */
> > -   { LENOVO_VENDOR_ID, 0x6004, 2540, 2540, &usbTabletPC   } /* Pen-only */
> > +   { LENOVO_VENDOR_ID, 0x6004, 10, 10, &usbTabletPC   } /* 
> > Pen-only */

this isn't upscaling, this is just using the right units (units/m instead of
units/inch)

ack to the two changes, but they need to be two patches - one to update the
W700, one to update the resolution into the right range. Plus a commit
message that mentions that the source data is hundredths of a mm, I had to
go check the source to understand why we're using 10 here.

Cheers,
   Peter

> >  };
> >  
> >  static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version)
> > @@ -572,7 +572,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
> > {
> > if (is_touch)
> > common->wcmTouchResolX =
> > -   (int)(((double)common->wcmMaxTouchX * 10.0
> > +   (int)(((double)common->wcmMaxTouchX * 10.0
> >  / (double)absinfo.maximum) + 0.5);
> > else
> > common->wcmMaxStripX = absinfo.maximum;
> > @@ -661,7 +661,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
> > {
> > if (is_touch)
> > common->wcmTouchResolY =
> > -(int)(((double)common->wcmMaxTouchY * 10.0
> > +(int)(((double)common->wcmMaxTouchY * 10.0
> >  / (double)absinfo.maximum) + 0.5);
> > else
> > common->wcmMaxStripY = absinfo.maximum;
> > -- 
> > 1.7.10.4

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [xf86-input-wacom PATCH 2/4] Add support for MT ISDv4 device 0x4001

2012-12-03 Thread Peter Hutterer
On Wed, Nov 21, 2012 at 12:14:10PM -0800, Ping Cheng wrote:
> It supports up to 10 fingers
> 
> Signed-off-by: Ping Cheng 

merged, thanks

Cheers,
   Peter

> ---
>  src/wcmUSB.c|1 +
>  src/wcmValidateDevice.c |1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index bfb0961..5cc7830 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -293,6 +293,7 @@ static struct
>   { WACOM_VENDOR_ID, 0xEF, 10, 10, &usbTabletPC   }, /* TabletPC 
> 0xEF */
>   { WACOM_VENDOR_ID, 0x100,10, 10, &usbTabletPC   }, /* TabletPC 
> 0x100 */
>   { WACOM_VENDOR_ID, 0x101,10, 10, &usbTabletPC   }, /* TabletPC 
> 0x101 */
> + { WACOM_VENDOR_ID, 0x4001,10, 10, &usbTabletPC   }, /* TabletPC 
> 0x4001 */
>  
>   /* IDs from Waltop's driver, available 
> http://www.waltop.com.tw/download.asp?lv=0&id=2.
>  Accessed 8 Apr 2010, driver release date 2009/08/11, fork of 
> linuxwacom 0.8.4.
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index 62adf1f..3571a34 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -269,6 +269,7 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
>  
>   case 0x100: /* TPC with MT */
>   case 0x101: /* TPC with MT */
> + case 0x4001: /* TPC with MT */
>   case 0xE2: /* TPC with 2FGT */
>   case 0xE3: /* TPC with 2FGT */
>   case 0xE5: /* TPC with MT */
> -- 
> 1.7.10.4
> 

> 

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [xf86-input-wacom PATCH 3/4] Post maximum number of contacts to clients

2012-12-03 Thread Peter Hutterer
On Wed, Nov 21, 2012 at 12:14:53PM -0800, Ping Cheng wrote:
> Clients should know the maximum number of contacts a touch device
> support before they get touch events.
> 
> Signed-off-by: Ping Cheng 
> 
> ---
> The following TO-Do takes more time than I have now. I list it
> here so we do not forget them.
> 
> X server supports pointer emulation for touch device. We should
> let X server take care of single touch events for both MT and
> single touch devices that are running on newer servers;
> 
> Touch events are currently all posted in relative mode (touchpad).
> We need to support absolute mode (touchscreen) devices.
> ---
>  src/wcmUSB.c|3 +++
>  src/xf86Wacom.c |6 +-
>  src/xf86WacomDefs.h |1 +
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 5cc7830..acce5ee 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -681,6 +681,9 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
>   {
>   private->wcmUseMT = 1;
>  
> + if (!ioctl(pInfo->fd, EVIOCGABS(ABS_MT_SLOT), &absinfo))
> + common->wcmMaxContacts = absinfo.maximum + 1;
> +
>   /* pen and MT on the same logical port */
>   if (ISBITSET(common->wcmKeys, BTN_TOOL_PEN))
>   private->wcmPenTouch = TRUE;
> diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
> index bb11cf4..808f5f8 100644
> --- a/src/xf86Wacom.c
> +++ b/src/xf86Wacom.c
> @@ -323,6 +323,7 @@ static int wcmDevInit(DeviceIntPtr pWcm)
>  {
>   InputInfoPtr pInfo = (InputInfoPtr)pWcm->public.devicePrivate;
>   WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
> + WacomCommonPtr common = priv->common;
>   unsigned char butmap[WCM_MAX_BUTTONS+1];
>   int nbaxes, nbbuttons, nbkeys;
>   int loop;
> @@ -421,7 +422,10 @@ static int wcmDevInit(DeviceIntPtr pWcm)
>  
>  #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 16
>   if (IsTouch(priv)) {
> - if (!InitTouchClassDeviceStruct(pInfo->dev, 0, 
> XIDependentTouch, 2)) {
> + if (!common->wcmMaxContacts)
> + common->wcmMaxContacts = 1;

a default of 0 means "don't know", and we should leave it at that.

Cheers,
   Peter

> +
> + if (!InitTouchClassDeviceStruct(pInfo->dev, 
> common->wcmMaxContacts, XIDependentTouch, 2)) {
>   xf86Msg(X_ERROR, "Unable to init touch class device 
> struct!\n");
>   return FALSE;
>   }
> diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> index 7df0e95..abfde70 100644
> --- a/src/xf86WacomDefs.h
> +++ b/src/xf86WacomDefs.h
> @@ -446,6 +446,7 @@ struct _WacomCommonRec
>/* tablet Z resolution is equivalent
> * to wcmMaxZ which is equal to 100% 
> pressure */
>   int wcmMaxDist;  /* tablet max distance value */
> + int wcmMaxContacts;  /* MT device max number of contacts */
>  
>   /*
>* TODO Remove wcmTiltOff*, once the kernel drivers reporting
> -- 
> 1.7.10.4

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [xf86-input-wacom PATCH 4/4] Update resoltuion for old kernels

2012-12-03 Thread Peter Hutterer
On Wed, Nov 21, 2012 at 12:15:22PM -0800, Ping Cheng wrote:
> We upscaled the resolutions in WacomModelDesc and for absinfos that
> support resolution. But we forgot to update them for older kernels
> that do not support resolution in absinfo.

help my memory - when did we upscale the resolution?
> 
> Signed-off-by: Ping Cheng 
> ---
>  src/wcmUSB.c |6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index acce5ee..418ccbc 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -331,7 +331,7 @@ static struct
>   { NTRIG_VENDOR_ID,  0x01, 44173, 36772, &usbTabletPC},
>  
>   /* Add in Lenovo W700 Palmrest digitizer */
> - { LENOVO_VENDOR_ID, 0x6004, 2540, 2540, &usbTabletPC   } /* Pen-only */
> + { LENOVO_VENDOR_ID, 0x6004, 10, 10, &usbTabletPC   } /* 
> Pen-only */
>  };
>  
>  static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version)
> @@ -572,7 +572,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
>   {
>   if (is_touch)
>   common->wcmTouchResolX =
> - (int)(((double)common->wcmMaxTouchX * 10.0
> + (int)(((double)common->wcmMaxTouchX * 10.0
>/ (double)absinfo.maximum) + 0.5);
>   else
>   common->wcmMaxStripX = absinfo.maximum;
> @@ -661,7 +661,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
>   {
>   if (is_touch)
>   common->wcmTouchResolY =
> -  (int)(((double)common->wcmMaxTouchY * 10.0
> +  (int)(((double)common->wcmMaxTouchY * 10.0
>/ (double)absinfo.maximum) + 0.5);
>   else
>   common->wcmMaxStripY = absinfo.maximum;
> -- 
> 1.7.10.4
> 
> 
> --
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
> 

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH 0/2] data: update SVG layouts

2012-12-03 Thread Peter Hutterer
On Fri, Nov 30, 2012 at 03:12:12PM +0100, Olivier Fourdan wrote:
> I never really liked the indentation for the SVG layouts, having one 
> SVG object per single line with attributes aligned induces way too 
> long lines that are harder to read and a burden to modify (believe me, 
> it's a pain to keep all those x/y/wifth/height aligned, and it doesn't 
> even help with clarity, quite the contrary)
> 
> I would rather adopt the usual SVG indentation as generated by 
> graphical tools such as Inkscape, that reduces the size of later 
> patches and improves their readability.

yeah, fair enough. I've merged these and all the standalone patches. Let me
know if I forgot any.

   37d5fd6..1366904  master -> master

Cheers,
   Peter

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH] lib: use integration flags from device info

2012-12-03 Thread Peter Hutterer
On Mon, Dec 03, 2012 at 10:53:31AM +0100, Olivier Fourdan wrote:
> Resend, sorry the commit message was the opposite of what I meant...

> >From 378edbc1b5caec1e27164d33dd4135a38b32f003 Mon Sep 17 00:00:00 2001
> From: Olivier Fourdan 
> Date: Mon, 3 Dec 2012 10:25:11 +0100
> Subject: [PATCH] lib: use integration flags from device info
> 
> if and only if the entry in the database did not set
> a value.
> 
> The flags set in the database entry should not be changed
> based on kernel flags unless the database did not set the
> integration flags.
> 

merged, thanks

Cheers,
   Peter

> Signed-off-by: Olivier Fourdan 
> ---
>  libwacom/libwacom.c |8 
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> index 23f3b08..7e88148 100644
> --- a/libwacom/libwacom.c
> +++ b/libwacom/libwacom.c
> @@ -142,6 +142,7 @@ get_device_info (const char*path,
>   g_type_init();
>  
>   retval = FALSE;
> + /* The integration flags from device info are unset by default */
>   *integration_flags = WACOM_DEVICE_INTEGRATED_UNSET;
>   *name = NULL;
>   bus_str = NULL;
> @@ -507,10 +508,9 @@ libwacom_new_from_path(WacomDeviceDatabase *db, const 
> char *path, WacomFallbackF
>   libwacom_update_match(ret, bus, vendor_id, product_id);
>  
>   if (device) {
> - if (integration_flags == WACOM_DEVICE_INTEGRATED_DISPLAY)
> - ret->integration_flags |= 
> WACOM_DEVICE_INTEGRATED_DISPLAY;
> - else if (integration_flags == WACOM_DEVICE_INTEGRATED_NONE)
> - ret->integration_flags &= 
> ~WACOM_DEVICE_INTEGRATED_DISPLAY;
> + /* if unset, use the kernel flags. Could be uset as well. */
> + if (ret->integration_flags == WACOM_DEVICE_INTEGRATED_UNSET)
> + ret->integration_flags = integration_flags;
>  
>   return ret;
>   }
> -- 
> 1.7.1
> 

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH] tools: increase timeout for animation

2012-12-03 Thread Peter Hutterer
On Fri, Nov 30, 2012 at 03:06:05PM +0100, Olivier Fourdan wrote:
> 

> >From 06ff3bab2f21f9b25191fb280ae5f25741c21cd1 Mon Sep 17 00:00:00 2001
> From: Olivier Fourdan 
> Date: Fri, 30 Nov 2012 11:37:17 +0100
> Subject: [PATCH] tools: increase timeout for animation
> 
> Signed-off-by: Olivier Fourdan 

merged, thanks

Cheers,
   Peter

> ---
>  tools/show-svg-image.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/show-svg-image.c b/tools/show-svg-image.c
> index fac8c45..d9e1ec0 100644
> --- a/tools/show-svg-image.c
> +++ b/tools/show-svg-image.c
> @@ -403,7 +403,7 @@ main (int argc, char **argv)
>  
>   g_signal_connect (tablet->widget, "expose-event", 
> G_CALLBACK(on_expose_cb), tablet);
>   g_signal_connect (tablet->widget, "delete-event", 
> G_CALLBACK(on_delete_cb), tablet);
> - tablet->timeout = g_timeout_add(500 /* ms */, (GSourceFunc) 
> on_timer_cb, tablet);
> + tablet->timeout = g_timeout_add(750 /* ms */, (GSourceFunc) 
> on_timer_cb, tablet);
>  
>   gtk_widget_show (tablet->widget);
>  
> -- 
> 1.7.1
> 

> --
> Keep yourself connected to Go Parallel: 
> TUNE You got it built. Now make it sing. Tune shows you how.
> http://goparallel.sourceforge.net

> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH 0/3] data: add leaders to layouts

2012-12-03 Thread Peter Hutterer
On Fri, Nov 30, 2012 at 02:56:40PM +0100, Olivier Fourdan wrote:
> Separated patches for the addition of leaders in layout files.

   c5c38f1..37d5fd6  master -> master


thanks

Cheers,
   Peter

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH] lib: constify parameters in API

2012-12-03 Thread Peter Hutterer
On Thu, Nov 29, 2012 at 07:07:18PM +0100, Olivier Fourdan wrote:
> [...]
> 
> Olivier Fourdan said the following on 11/29/2012 05:49 PM:
> >>sorry, I didn't spot this earlier, this should be const WacomDevice *device.
> >>>  (only noticed that when doing some printf testing on my device). Given 
> >>> that
> >>>  is_builtin, is_reversible, etc aren't const we should update all of them 
> >>> in
> >>>  a follow-up patch.
> >>>
> >Yes, I simply copy/pasted from one of the previous functions... I'll
> >send a separate global "constification" patch.
> 
> The /big/ constification patch... goes on top of the integration bits.

applied, thanks.

Cheers,
   Peter

> From 36a4afefcc4fcf89fa7c1e917c97926e3945a152 Mon Sep 17 00:00:00 2001
> From: Olivier Fourdan 
> Date: Thu, 29 Nov 2012 18:52:36 +0100
> Subject: [PATCH] lib: constify parameters in API
> 
> Signed-off-by: Olivier Fourdan 
> ---
>  libwacom/libwacom-database.c |2 +-
>  libwacom/libwacom.c  |   86 -
>  libwacom/libwacom.h  |   70 +-
>  3 files changed, 78 insertions(+), 80 deletions(-)
> 
> diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
> index e0ee52e..9813a4e 100644
> --- a/libwacom/libwacom-database.c
> +++ b/libwacom/libwacom-database.c
> @@ -622,7 +622,7 @@ libwacom_database_destroy(WacomDeviceDatabase *db)
>  }
>  
>  WacomDevice**
> -libwacom_list_devices_from_database(WacomDeviceDatabase *db, WacomError 
> *error)
> +libwacom_list_devices_from_database(const WacomDeviceDatabase *db, 
> WacomError *error)
>  {
>   GList *cur, *devices;
>   WacomDevice **list, **p;
> diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> index 23f3b08..b03fe0b 100644
> --- a/libwacom/libwacom.c
> +++ b/libwacom/libwacom.c
> @@ -48,7 +48,7 @@
>  #endif
>  
>  static const WacomDevice *
> -libwacom_get_device(WacomDeviceDatabase *db, const char *match)
> +libwacom_get_device(const WacomDeviceDatabase *db, const char *match)
>  {
>   return (WacomDevice *) g_hash_table_lookup (db->device_ht, match);
>  }
> @@ -337,7 +337,7 @@ libwacom_copy(const WacomDevice *device)
>  
>  
>  static int
> -compare_matches(WacomDevice *a, WacomDevice *b)
> +compare_matches(const WacomDevice *a, const WacomDevice *b)
>  {
>   const WacomMatch **ma, **mb, **match_a, **match_b;
>  
> @@ -359,7 +359,7 @@ compare_matches(WacomDevice *a, WacomDevice *b)
>  
>  /* Compare layouts based on file name, stripping the full path */
>  static gboolean
> -libwacom_same_layouts (WacomDevice *a, WacomDevice *b)
> +libwacom_same_layouts (const WacomDevice *a, const WacomDevice *b)
>  {
>   gchar *file1, *file2;
>  
> @@ -378,7 +378,7 @@ libwacom_same_layouts (WacomDevice *a, WacomDevice *b)
>  }
>  
>  int
> -libwacom_compare(WacomDevice *a, WacomDevice *b, WacomCompareFlags flags)
> +libwacom_compare(const WacomDevice *a, const WacomDevice *b, 
> WacomCompareFlags flags)
>  {
>   g_return_val_if_fail(a || b, 0);
>  
> @@ -442,7 +442,7 @@ libwacom_compare(WacomDevice *a, WacomDevice *b, 
> WacomCompareFlags flags)
>  }
>  
>  static const WacomDevice *
> -libwacom_new (WacomDeviceDatabase *db, int vendor_id, int product_id, 
> WacomBusType bus, WacomError *error)
> +libwacom_new (const WacomDeviceDatabase *db, int vendor_id, int product_id, 
> WacomBusType bus, WacomError *error)
>  {
>   const WacomDevice *device;
>   char *match;
> @@ -460,7 +460,7 @@ libwacom_new (WacomDeviceDatabase *db, int vendor_id, int 
> product_id, WacomBusTy
>  }
>  
>  WacomDevice*
> -libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, 
> WacomFallbackFlags fallback, WacomError *error)
> +libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, 
> WacomFallbackFlags fallback, WacomError *error)
>  {
>   int vendor_id, product_id;
>   WacomBusType bus;
> @@ -522,7 +522,7 @@ bail:
>  }
>  
>  WacomDevice*
> -libwacom_new_from_usbid(WacomDeviceDatabase *db, int vendor_id, int 
> product_id, WacomError *error)
> +libwacom_new_from_usbid(const WacomDeviceDatabase *db, int vendor_id, int 
> product_id, WacomError *error)
>  {
>   const WacomDevice *device;
>  
> @@ -541,7 +541,7 @@ libwacom_new_from_usbid(WacomDeviceDatabase *db, int 
> vendor_id, int product_id,
>  }
>  
>  WacomDevice*
> -libwacom_new_from_name(WacomDeviceDatabase *db, const char *name, WacomError 
> *error)
> +libwacom_new_from_name(const WacomDeviceDatabase *db, const char *name, 
> WacomError *error)
>  {
>   const WacomDevice *device;
>   GList *keys, *l;
> @@ -570,7 +570,7 @@ libwacom_new_from_name(WacomDeviceDatabase *db, const 
> char *name, WacomError *er
>   return NULL;
>  }
>  
> -static void print_styli_for_device (int fd, WacomDevice *device)
> +static void print_styli_for_device (int fd, const WacomDevice *device)
>  {
>   int nstyli;
>   const int *styli;
> @@ -587,7 +587,7 @@ static void print_styli_for_device (int fd, WacomDevice 
> 

[Linuxwacom-devel] libwacom: set of patches...

2012-12-03 Thread Olivier Fourdan
Hi all,

I admit I tend to get lost a bit myself with all the patches I sent, 
so if you're like me, I placed the full list of patches here:

 http://people.redhat.com/ofourdan/libwacom/patches/

These patches are meant to go on top of current (as of today) git master.

Hope it helps :)

Cheers,
Olivier.

--
Keep yourself connected to Go Parallel: 
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] libwacom: [PATCH] lib: use integration flags from device info

2012-12-03 Thread Olivier Fourdan

Resend, sorry the commit message was the opposite of what I meant...
>From 378edbc1b5caec1e27164d33dd4135a38b32f003 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan 
Date: Mon, 3 Dec 2012 10:25:11 +0100
Subject: [PATCH] lib: use integration flags from device info

if and only if the entry in the database did not set
a value.

The flags set in the database entry should not be changed
based on kernel flags unless the database did not set the
integration flags.

Signed-off-by: Olivier Fourdan 
---
 libwacom/libwacom.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 23f3b08..7e88148 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -142,6 +142,7 @@ get_device_info (const char*path,
 	g_type_init();
 
 	retval = FALSE;
+	/* The integration flags from device info are unset by default */
 	*integration_flags = WACOM_DEVICE_INTEGRATED_UNSET;
 	*name = NULL;
 	bus_str = NULL;
@@ -507,10 +508,9 @@ libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, WacomFallbackF
 	libwacom_update_match(ret, bus, vendor_id, product_id);
 
 	if (device) {
-		if (integration_flags == WACOM_DEVICE_INTEGRATED_DISPLAY)
-			ret->integration_flags |= WACOM_DEVICE_INTEGRATED_DISPLAY;
-		else if (integration_flags == WACOM_DEVICE_INTEGRATED_NONE)
-			ret->integration_flags &= ~WACOM_DEVICE_INTEGRATED_DISPLAY;
+		/* if unset, use the kernel flags. Could be uset as well. */
+		if (ret->integration_flags == WACOM_DEVICE_INTEGRATED_UNSET)
+			ret->integration_flags = integration_flags;
 
 		return ret;
 	}
-- 
1.7.1

--
Keep yourself connected to Go Parallel: 
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] libwacom: [PATCH] lib: use integration flags from device info

2012-12-03 Thread Olivier Fourdan
Following the comments from Peter regarding /not/ changing the 
integration flags when set in the database.
>From 63808789de413dc4ea60fadc7bb897cc870b008d Mon Sep 17 00:00:00 2001
From: Olivier Fourdan 
Date: Mon, 3 Dec 2012 10:25:11 +0100
Subject: [PATCH] lib: use integration flags from device info

if and only if the entry in the database did not set
a value.

The flags set in the database entry should be changed
based on kernel flags unless the database did not set
the integration flags.

Signed-off-by: Olivier Fourdan 
---
 libwacom/libwacom.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 23f3b08..7e88148 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -142,6 +142,7 @@ get_device_info (const char*path,
 	g_type_init();
 
 	retval = FALSE;
+	/* The integration flags from device info are unset by default */
 	*integration_flags = WACOM_DEVICE_INTEGRATED_UNSET;
 	*name = NULL;
 	bus_str = NULL;
@@ -507,10 +508,9 @@ libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, WacomFallbackF
 	libwacom_update_match(ret, bus, vendor_id, product_id);
 
 	if (device) {
-		if (integration_flags == WACOM_DEVICE_INTEGRATED_DISPLAY)
-			ret->integration_flags |= WACOM_DEVICE_INTEGRATED_DISPLAY;
-		else if (integration_flags == WACOM_DEVICE_INTEGRATED_NONE)
-			ret->integration_flags &= ~WACOM_DEVICE_INTEGRATED_DISPLAY;
+		/* if unset, use the kernel flags. Could be uset as well. */
+		if (ret->integration_flags == WACOM_DEVICE_INTEGRATED_UNSET)
+			ret->integration_flags = integration_flags;
 
 		return ret;
 	}
-- 
1.7.1

--
Keep yourself connected to Go Parallel: 
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel