[PATCH 2/2] Use event time instead of CurrentTime for grab times

Chase Douglas chase.douglas at canonical.com
Fri Jan 13 00:03:42 PST 2012


On 01/13/2012 02:05 AM, Peter Hutterer wrote:
> On Wed, Jan 11, 2012 at 07:38:12AM -0800, Chase Douglas wrote:
>> When {XI,X,}AllowEvents is called, the timestamp is compared against the
>> grab time to ensure that the request pertains to the current grab in the
>> server. While many clients may use CurrentTime (client-side), the
>> timestamp of the event causing the grab is also valid.
>>
>> This change ensures that the server's notion of the grab time is the
>> time of the event that activated the grab rather than the time that the
>> grab is actually activated.
>>
>> This bug was exposed through nested touch then pointer grabs.
>>
>> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
>> ---
>>  dix/events.c |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/dix/events.c b/dix/events.c
>> index 5360267..d4b00e0 100644
>> --- a/dix/events.c
>> +++ b/dix/events.c
>> @@ -3723,7 +3723,8 @@ ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event,
>>          }
>>      }
>>  
>> -    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
>> +    (*grabinfo->ActivateGrab)(device, grab,
>> +                              ClientTimeToServerTime(event->any.time), TRUE);
>>  
>>      if (xE)
>>      {
>> -- 
>> 1.7.7.3
> 
> fwiw, I've merged this one, unsure about the other one at this point, see
> the comment there.

I didn't get a reply for patch 1. What was your comment?

-- Chase


More information about the xorg-devel mailing list