[PATCH inputproto multitouch] Touch IDs must be at least unique per master device

Chase Douglas chase.douglas at canonical.com
Sun Dec 11 21:00:36 PST 2011


On 12/10/2011 07:04 PM, Peter Hutterer wrote:
> On Fri, Dec 09, 2011 at 01:43:44PM -0800, Chase Douglas wrote:
>> From: Chase Douglas <cndougla at cndougla.(none)>
>>
>> XIAllowEvents with a master device and a touch ID must uniquely identify
>> a touch sequence. If touch IDs were unique per slave device, multiple
>> slave devices could have valid sequences with the same touch ID, and the
>> sequences may both be grabbed through the same master device grab.
>>
>> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
>> ---
>>  specs/XI2proto.txt |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt
>> index c467bb1..d7b733b 100644
>> --- a/specs/XI2proto.txt
>> +++ b/specs/XI2proto.txt
>> @@ -2151,7 +2151,7 @@ Touch tracking IDs are provided in the detail field of touch events. Its
>>  value is always provided in every touch event. Tracking IDs are
>>  represented as unsigned 32-bit values and increase in value for each new
>>  touch, wrapping back to 0 upon reaching the numerical limit of IDs. IDs are
>> -unique per each slave touch device.
>> +unique per each master device.
> 
> how about "unique per device". that effectively (in the implementation)
> means unique for the master but there's nothing particularly wrong with
> having two SDs use the same ID if it's wrapped correctly (no, we won't write
> the code for that, it's easier with server-wide IDs)

That feels ambiguous to me, but on irc you pointed out that "per each
master device" is bad because it doesn't cover the floating slave device
use case.

The X.org implementation will use globally unique touch IDs because it's
easiest. It covers up potential issues with floating vs slave devices,
and transitions between attached and floating.

Thus, rather than make the protocol hard to comprehend by covering all
the potential corner cases, lets just make the IDs globally unique. I'll
send around a second version of the patch for review.

> also, we should add a note that IDs are not guaranteed to be sequentially,
> touch IDs may skip ahead by a few. clients _should_ know that implicitly
> but better to spell it out

I guess. It does seem a bit obvious, but I can send a patch out for this
too.

-- Chase


More information about the xorg-devel mailing list