Comment 18 for bug 1015183

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Hi Martin,

Thanks for finding this issue. Good work on making some patches, but I don't think they are quite right. We need to set the internal button state of the device when the touch begin comes in, otherwise we will not get the right result when we call {X,XI}QueryPointer().

A simpler solution would be to modify DeliverTouchEmulatedEvent(). There is the following line:

ptrev->device_event.corestate = event_get_corestate(dev, kbd);

We need to modify it so that it also passes in a boolean to event_get_corestate() to determine whether to mix the touch emulated button state in with the normal button state. Then, we tell the function to mix in the touch emulated state only on touch update and end events. We can reason that this is correct because only one touch may be emulated at a time per device, and because only one window may receive an emulated button press for the touch begin at a time.

I will attempt to make a test and a patch for this tomorrow.

Thanks!