[PATCH 5/5] Implement touch early accept

Chase Douglas chase.douglas at canonical.com
Fri Feb 3 09:58:03 PST 2012


On 02/03/2012 09:02 AM, Peter Hutterer wrote:
> On Thu, Feb 02, 2012 at 04:57:58PM -0800, Chase Douglas wrote:
>> From: Chase Douglas <chase.douglas at ubuntu.com>
>>
>> This doesn't really implement early accept as it should. Ideally, the
>> server should send end events to all subsequent touch clients as soon as
>> an early accept comes in. However, this implementation is still protocol
>> compliant. We can always improve it later.
>>
>> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
>> ---
>>  Xi/exevents.c   |   29 +++++++++++++++++++++++++----
>>  dix/touch.c     |    9 ++++-----
>>  include/input.h |    2 ++
>>  3 files changed, 31 insertions(+), 9 deletions(-)
>>
>> diff --git a/Xi/exevents.c b/Xi/exevents.c
>> index 6b2db4b..d0e0a5e 100644
>> --- a/Xi/exevents.c
>> +++ b/Xi/exevents.c
>> @@ -1088,6 +1088,26 @@ DeliverOneTouchEvent(ClientPtr client, DeviceIntPtr dev, TouchPointInfoPtr ti,
>>      return TRUE;
>>  }
>>  
>> +static void
>> +ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti)
>> +{
>> +    int rc;
>> +    ClientPtr client;
>> +    XID error;
>> +
>> +    rc = dixLookupClient(&client, ti->listeners[0].listener, serverClient,
>> +                         DixSendAccess);
>> +    if (rc != Success)
>> +    {
>> +        ErrorF("[Xi] Failed to lookup early accepting client.\n");
>> +        return;
>> +    }
>> +
>> +    if (AllowTouch(client, dev, XIAcceptTouch, ti->client_id,
>> +        ti->listeners[0].window->drawable.id, &error) != Success)
>> +        ErrorF("[Xi] Failed to accept touch grab after early acceptance.\n");
> 
> wouldn't this send two ownership events to the same client? something is
> missing here, I think

It shouldn't. We're calling AllowTouch just like would be called if the
client called XIAllowTouchEvents. I'll find out more after some testing...

-- Chase


More information about the xorg-devel mailing list