Summary: | Touch event history replay doesn't end the touch | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Daniel Drake <dan> | ||||||
Component: | Server/Input/Core | Assignee: | Peter Hutterer <peter.hutterer> | ||||||
Status: | RESOLVED WONTFIX | QA Contact: | Xorg Project Team <xorg-team> | ||||||
Severity: | normal | ||||||||
Priority: | medium | CC: | chase.douglas, peter.hutterer | ||||||
Version: | unspecified | ||||||||
Hardware: | Other | ||||||||
OS: | All | ||||||||
Whiteboard: | |||||||||
i915 platform: | i915 features: | ||||||||
Attachments: |
|
Description
Daniel Drake
2012-09-06 20:57:53 UTC
Created attachment 66749 [details]
xinput test-xi2 output showing spurious TouchBegin
Forgot to mention, I believe this spurious touch is leading to the real issue in question, which is where after touching (and releasing) the screen for the first time, moving the mouse around the screen (with the touchpad) acts as if the first moust button is held down - its not. Digging further, maybe that is not the issue. I now understand that there are effectively two touches tracked for when I touch the screen (one on the touchscreen device, one on the core pointer). So it is OK if one of the touches is destroyed with TouchEndTouch() if the other touch is still alive and can carry the appropriate flags to generate the appropriate sequence of events. So, in more detail, here is what is happening, in response to a quick tap-and-release: evdev sends XI_TouchBegin as my finger touches the screen. ProcessTouchEvent() is called with ET_TouchBegin for the touchscreen device. DeliverTouchEvents calls DeliverTouchEvent, things look OK. ProcessTouchEvent() is called with ET_TouchBegin for the Virtual core pointer DeliverTouchEvents calls DeliverTouchEvent, things look OK. evdev sends XI_TouchEnd as my finger leaves the screen. ProcessTouchEvent() is called with ET_TouchEnd for the touchscreen device. DeliverTouchEvents calls DeliverTouchEvent, things look OK. TouchEndTouch() is called. So the touch relating to the touchscreen device is now complete - all events have been reported correctly and now it has been destroyed. We're just left with handling the completion of the other touch: ProcessTouchEvent() is called with ET_TouchEnd for the Virtual core pointer. DeliverTouchEvents calls DeliverTouchEvent. We reach DeliverTouchEndEvent(), with listener type LISTENER_POINTER_GRAB and state LISTENER_IS_OWNER. So we call into DeliverTouchEmulatedEvent(). Presumably due to DeliverTouchEmulatedEvent() (haven't examined exactly what this function does), we end up in ProcessTouchEvent() for a ET_TouchOwnership event for the virtual core pointer. This leads to ProcessTouchOwnershipEvent() being called with reason XIRejectTouch and EmitTouchEnd() is called. This leads us to DeliverTouchEvents() being called with an ET_TouchEnd event, which calls DeliverTouchEvent() which calls DeliverTouchEndEvent() again (listener type LISTENER_POINTER_GRAB and state LISTENER_IS_OWNER). After calling DeliverTouchEmulatedEvent(), which returns without triggering any of my trace points, we hit this code: if (ti->num_listeners > 1) { ev->any.type = ET_TouchUpdate; ev->device_event.flags |= TOUCH_PENDING_END; if (!(ev->device_event.flags & TOUCH_CLIENT_ID)) ti->pending_finish = TRUE; } num_listeners is 1, but device_event.flags is 0x2a (TOUCH_CLIENT_ID is set) so we don't mark it as pending_finish. Immediately after, TouchPuntToNextOwner() is called. This replays the history, generating an ET_TouchBegin, but it doesn't generate ET_TouchEnd because pending_finish was never set. If I modify the code snippet above to not check for TOUCH_CLIENT_ID, unconditionally setting ti->pending_finish at that point, test-xi2 reports behaviour that looks better to me. I can't say I fully understand this sequence of events and the concept of replaying touches and so on, but what does happen now is that the final generated TouchBegin is terminated with a TouchEnd, which makes sense to me given that my finger isn't on the screen. However, this doesn't solve my original problem :( Even with this TouchEnd event added, Motion events generated by the touchpad on the virtual core pointer beyond this point have the first button bit set, even though no mouse buttons or screens are pressed. So I need to keep working on that. The mouse-button-held-down issue is fixed by http://lists.x.org/archives/xorg-devel/2012-September/033595.html This is a mass change of bugs. Bugs assigned to me that haven't been updated in the last 3 years are closed as WONTFIX, because, well, let's at least be honest about it. Please do not re-open unless you have a really good reason to do so (e.g. you're fixing it yourself). If it hasn't been fixed in the last 3 years, it probably won't be fixed anytime soon either. Sorry. |
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.