You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS touch IDs are unstable - reassigned when touches are added/removed #589
I think touch IDs on iOS are unstable and change when new touches are added or removed, breaking multitouch tracking. The IDs are just array indices (0, 1, 2...) rather than stable identifiers tied to the actual UITouch objects.
Steps to Reproduce
Touch the screen with one finger (gets ID 0)
While keeping first finger down, touch with a second finger
Observe that the first touch now has ID 1 and the second touch has ID 0
Root Cause
In src/native/ios.rs lines 139-154, the code uses a loop counter as the touch ID:
for touch_id in0..size {let ios_touch:ObjcId = msg_send![enumerator, nextObject];// ...send_message(Message::Touch{
phase,
touch_id,// This is just 0, 1, 2... not a stable ID// ...});}
Suggested Fix
Use the UITouch pointer itself as the touch ID:
for _ in0..size {let ios_touch:ObjcId = msg_send![enumerator, nextObject];let touch_id:u64 = ios_touch asu64;// Use pointer as stable ID// ...}
Impact
Any application using touch IDs to track individual fingers (e.g., dual-stick controls, multitouch gestures) will fail with more than one simultaneous touch.
Environment
miniquad version: 0.4.8
Platform: iOS (tested on iPhone 16, iOS 18.6.2)
Activity