Problem in AllowSome() function in Xorg

Daniel Stone daniel at fooishbar.org
Tue Jun 21 06:36:16 PDT 2011


Hi,

On Mon, Apr 11, 2011 at 07:08:42PM +0900, Park Sung-Jin wrote:
> If I touch(=press) on a window of a client with two fingers(id=9, 10)
> and release very quickly, the grab of the button(id=9) was not removed
> even if I released the button.
> According to my observation, though Xorg server tries to remove the
> grab of the button(id=9), the grab cannot be removed because of the
> 'grabTime'.
> 
> When I touch on the window of the client with two fingers, each grab
> for each finger's button will be created.
> Let's assume that the grabTime of the first finger was gt1 and second
> finger's grabTime was gt2 which was bigger than gt1.
> At the moment, if the client sent an 'AllowEvent' request to Xorg
> server to ReplayPointer,
> Xorg server checked whether the grabTime(cgt) from the client is valid or not.
> The grabTime(cgt) must be in between the server's grabTime(gt1) and
> server's currentTime.
> 
> But in AllowSome() function, grabTime(gt1) was updated to gt2.
> ==========================================================
> void
> AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState)
> {
>     ...
> }
> ==========================================================
> 
> After updated grabTime, server checked both of the following:
> (1) grabTime(gt2) <= cgt
> (2) cgt <= currentTime
> 
> As you can see, cgt was smaller than gt2, so server does nothing and
> returns without removing 1st finger's grab.
> Please let me know what to do for solving this problem. :)

I'd thought that this might've been caused by the initial MPX work which
attempted to support multiple grabs on the same device, but it turns out
that bug has been present ever since XFree86.  Their revision history is
useless, but my guess is that it was added as a crutch when Xi was
merged.

I'm kind of nervous about removing this since I'm sure there are apps
which depend upon it, but maybe there's a middle ground we can work with
here -- only do it for core grabs, and/or devices which are grabbed by
the same client, or paired with each other.

Peter?

Cheers,
Daniel


More information about the xorg-devel mailing list