On Thu, Jan 6, 2011 at 2:56 PM, Peter Hutterer <[email protected]> wrote: > On Thu, Jan 06, 2011 at 11:23:51AM -0800, Ping Cheng wrote: >> On Wed, Jan 5, 2011 at 11:00 PM, Peter Hutterer >> <[email protected]> wrote: >> > If we're going out of proximity, don't post an event. >> > >> > Signed-off-by: Peter Hutterer <[email protected]> >> > --- >> > src/wcmCommon.c | 3 ++- >> > 1 files changed, 2 insertions(+), 1 deletions(-) >> > >> > diff --git a/src/wcmCommon.c b/src/wcmCommon.c >> > index 0b89c0c..93837f7 100644 >> > --- a/src/wcmCommon.c >> > +++ b/src/wcmCommon.c >> > @@ -402,7 +402,8 @@ static int getWheelButton(InputInfoPtr pInfo, const >> > WacomDeviceState* ds, >> > } >> > >> > /* emulate events for absolute wheel when it is a touch ring (on >> > pad) */ >> > - if ( (ds->abswheel != priv->oldWheel) && IsPad(priv) ) >> > + if ( (ds->abswheel != priv->oldWheel) && IsPad(priv) && >> > + (priv->oldProximity == ds->proximity)) >> >> This assumes that we have out-prox event for pad. For generic devices, >> pad is considered as always in-prox. > > in that case, priv->oldProximity should be the same as ds->proximity, so it > should still trigger, right?
yeah, I was stuck with the == sign, I guess. >> Another idea comes up when I read this patch. For both ring and >> strips, the time that we want to post an event is when the finger >> moved on the ring or strip in a direction. If it stays at or touches >> one point then leaves, the value below can be non-zero. But we can not >> post an event since there is no movement on the surface involved. This >> case could happen if ds->abswheel = 0 (leaving) or priv->oldWheel = 0 >> (touching). A check to !ds->abswheel && !priv->oldWheel need to be >> added to the above if-statement. priv->oldStripX/Y and ds->stripx/y >> need to be considered for patch 5/5. > > that's what I had originally (one reason I introduced the MAX_PAD_RING > define) but then I figured if we have proximity, we should use it as > intended :) But if we don't get out-prox event, oldProximity would always be the same as proximity, right? A check on zero safeguards that case. It's a corner case. But I do see events emitted when touch and leave on one point sometime. I have no more question about 5/5. Reviewed-by: Ping Cheng <[email protected]> for the whole set. Ping ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
