On Thu, Dec 16, 2010 at 10:51:13AM -0600, Chris Bagwell wrote: > I must admit this patch is really confusing me. I'm not sure if it > works stand alone but not really worth it changing it even if it > doesn't.
yeah, as I said in the cover letter this patchset evolved more so than it was designed. by the time I grasped the concept I already had a lot of patches that were really hard to rebase and half of it undid the other half (making said rebases quite nasty). I left this one in mainly for the commit message, because I was stuck too long in the "absolute mode means post absolute events" mindset. some more explanation: an absolute device will post events that result in the cursor being moved to the position of the event. so if you touch your tablet in the upper left corner, the cursor moves there. this is the default mode of the tablet. a relative device will post events that result in a cursor movement relative to the current position. this is the default mode of a touchpad, if you touch in the upper left corner, the cursor doesn't move. it only starts moving (away from the current position) once you move your finger away from the initial point of touch. these are the two modes, but they describe a _behaviour_ of the device, not how the device posts its events. a device that is relative can still post absolute events, and vice versa. e.g. if you know the cursor is at 500/500 and you touch the device at 1000/1000, you can either post an absolute event for [1000, 1000] or a relative event for [500, 500]. either way, the cursor ends up at 1000/1000 and the device behaviour is the same. > By the time I get to patches 8, 9, and 13 everything is understandable > by just looking at patch though and overrides this patch anyways. > > Overall, very nice cleanup and much easier to understand now. > > In the past, I toyed with sending "pad" buttons of Bamboo along with > the "touch" device. It was this tricky area of code that made me run > away screaming from that idea. Now, with this refactor, maybe its not > so hard a job to do. > > Reviewed-by: Chris Bagwell <[email protected]> thanks Cheers, Peter > On Wed, Dec 15, 2010 at 4:06 PM, Peter Hutterer > <[email protected]> wrote: > > We claim the pad is a relative device, but only because we had troubles with > > the cursor landing at 0/0 in the past. Pretend we're still a relative > > device, but post the values as absolute ones to the server. > > > > Note that the device mode is to tell how the device _behaves_, it doesn't > > specify how the device sends valuators. Thus, a relative device may only > > post absolute coordinates and vice versa. > > > > This applies to motion events only, button events for the scroll ring still > > have the wrong valuator information. > > > > Signed-off-by: Peter Hutterer <[email protected]> > > --- > > src/wcmCommon.c | 32 ++++++++++++++++---------------- > > 1 files changed, 16 insertions(+), 16 deletions(-) > > > > diff --git a/src/wcmCommon.c b/src/wcmCommon.c > > index 79caffa..70ea9ed 100644 > > --- a/src/wcmCommon.c > > +++ b/src/wcmCommon.c > > @@ -670,25 +670,25 @@ void wcmSendEvents(InputInfoPtr pInfo, const > > WacomDeviceState* ds) > > priv->oldButtons = 0; > > } > > > > - if (!is_absolute(pInfo)) > > + if (type != PAD_ID) > > { > > - x -= priv->oldX; > > - y -= priv->oldY; > > - z -= priv->oldZ; > > - if (IsCursor(priv)) > > - { > > - v3 -= priv->oldRot; > > - v4 -= priv->oldThrottle; > > - } else > > + if (!is_absolute(pInfo)) > > { > > - v3 -= priv->oldTiltX; > > - v4 -= priv->oldTiltY; > > + x -= priv->oldX; > > + y -= priv->oldY; > > + z -= priv->oldZ; > > + if (IsCursor(priv)) > > + { > > + v3 -= priv->oldRot; > > + v4 -= priv->oldThrottle; > > + } else > > + { > > + v3 -= priv->oldTiltX; > > + v4 -= priv->oldTiltY; > > + } > > + v5 -= priv->oldWheel; > > } > > - v5 -= priv->oldWheel; > > - } > > > > - if (type != PAD_ID) > > - { > > /* coordinates are ready we can send events */ > > if (is_proximity) > > { > > @@ -756,7 +756,7 @@ void wcmSendEvents(InputInfoPtr pInfo, const > > WacomDeviceState* ds) > > /* xf86PostMotionEvent is only needed to post the > > valuators > > * It should NOT move the cursor. > > */ > > - xf86PostMotionEventP(pInfo->dev, > > is_absolute(pInfo), 3, 3, valuators); > > + xf86PostMotionEventP(pInfo->dev, TRUE, 3, 3, > > valuators); > > } > > else > > { > > -- > > 1.7.3.3 > > > ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
