-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identifiers for touch points are not constant in multi touch #698
Comments
WebKit issue: https://bugs.webkit.org/show_bug.cgi?id=270516 |
This is interesting. I wonder if you could try again with main/master but reverting WPE - Make TouchPoint ID unique - commit 057b735cbf912f620273106541f2196191c5aa53 and reporting back the results. |
update: From the https://bugs.webkit.org/show_bug.cgi?id=270516 link I see @gebausim you are pointing to the same direction. 🙏🏼 |
On a multitouch screen, when several fingers are on the screen at the same time, if we set to null surface and target on touch_on_up() then we stop all the ongoing touch gestures and not only the one of the finger that caused the up event. That is becasue touch_on_motion() will refuse to process further events if surface or target are null. Instead of doing that do not set to null this pointers on the touch_on_up() event. The value of those will be set again on the next touch_on_down() event in any case. Related: Igalia#698 Related: https://bugs.webkit.org/show_bug.cgi?id=270516
This two patches fix this issue for me: |
Just tested with the patches applied and everything seems to work as expected, thanks! |
On a multitouch screen, when several fingers are on the screen at the same time, if we set to null surface and target on touch_on_up() then we stop all the ongoing touch gestures and not only the one of the finger that caused the up event. That is becasue touch_on_motion() will refuse to process further events if surface or target are null. Instead of doing that do not set to null this pointers on the touch_on_up() event. The value of those will be set again on the next touch_on_down() event in any case. Also make seat->touch_target a weak reference, that way if the CogViewport gets destroyed before the touch-move and/or touch-up events arrive it will be set to NULL automatically and we avoid use-after-free of a stale pointer. Related: Igalia#698 Related: https://bugs.webkit.org/show_bug.cgi?id=270516
On a multitouch screen, when several fingers are on the screen at the same time, if we set to null surface and target on touch_on_up() then we stop all the ongoing touch gestures and not only the one of the finger that caused the up event. That is becasue touch_on_motion() will refuse to process further events if surface or target are null. Instead of doing that do not set to null this pointers on the touch_on_up() event. The value of those will be set again on the next touch_on_down() event in any case. Also make seat->touch_target a weak reference, that way if the CogViewport gets destroyed before the touch-move and/or touch-up events arrive it will be set to NULL automatically and we avoid use-after-free of a stale pointer. Related: #698 Related: https://bugs.webkit.org/show_bug.cgi?id=270516
Propably the best way to showcase this is via https://people.igalia.com/clopez/wkbug/pointer-events/paint.html page. Reproduced by simultaneously doing the snake move with one finger on the right and multiple lines with the other hand. What is expected is the first touch not to be influenced by the other ones and remain the same color/id (red) all the way.
Got:
Expected:
Same issue can also be observed in https://patrickhlauke.github.io/touch/tracker/multi-touch-tracker-index.html page. Where the identifier numbers rapidly change between all the currently active touch ids.
Can be reproduced on cog 0.18 and master with the wayland backend with WPEWebKit 2.42.5. It does not occur with WPEWebKit 2.40.5 or 2.38.6.
The effects of this are that any javascript pan or zoom gestures don't work properly, can be tested on https://elmarquis.github.io/Leaflet.GestureHandling/examples/. Zooming on the map is just very funky. Basically any online maps don't work.
The text was updated successfully, but these errors were encountered: