Touch-emulated pointer events must have the same button state as non-emulated button events. Touch sequence: TouchBegin TouchUpdate TouchEnd Expected pointer events (state): Motion(0x0) ButtonPress(0x0) Motion(0x100) ButtonRelease(0x100) Currently the state is: Motion(0x100) ButtonPress(0x100) Motion(0x100) ButtonRelease(0x0) Cause is that the button events are delivered after the touch events, which update the pointer state. Carlo's patch http://lists.freedesktop.org/archives/xorg-devel/2012-October/034229.html fixes the state for the initial Motion event.
Created attachment 69284 [details] [review] 0001-Xi-put-the-state-into-the-event-_before_-updating-th.patch Tentative patch. I don't have a full set of tests yet, especially in regards to checking the correct states on touch events, but it passes my tests for pointer emulation checks.
Thanks for finding/investigating Peter. Carlos Garnacho has tested the above patch; it does fix a problem that we are seeing in OLPC/Sugar. http://bugs.sugarlabs.org/ticket/4133
(In reply to comment #1) > Created attachment 69284 [details] [review] [review] > 0001-Xi-put-the-state-into-the-event-_before_-updating-th.patch > > Tentative patch. I don't have a full set of tests yet, especially in regards > to checking the correct states on touch events, but it passes my tests for > pointer emulation checks. Hey Peter :), been trying out this patch, but it brings in other issues on touch events, doing event_set_state() on the ET_Touch* InternalEvent itself (as opposed to the made up motion/button ones) makes touch events contain button 1 set in the mask, which do cause other glitches on how events get to GTK+. Now, I can see the usefulness of setting the paired keyboard modifier mask on touch events, I'm attaching 2 patches to do that separately, although this other issue probably belongs to another bug
Created attachment 69366 [details] [review] patch, update device state after delivering emulated events
Created attachment 69367 [details] [review] patch, set modifier mask on touch events
Whoops, you're right. I forgot that the button state shouldn't include touch. Patches look good. I'll test them a bit more but expect them upstream soon. thanks!
commit 863f32c930d71073ee5f78452b78bd459d024867 Author: Carlos Garnacho <carlosg@gnome.org> Date: Wed Oct 31 19:32:57 2012 +0100 Xi: Update the device after delivering the emulated pointer event(#56558)
commit b4e44b285ed0eee1d06514215a4b01d54f40094b Author: Carlos Garnacho <carlosg@gnome.org> Date: Wed Oct 31 19:29:45 2012 +0100 Xi: Set modifier mask on touch events
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.