rust-windowing / rust-windowing/winit

iOS: `FingerId` may not be stable

Open
#3,970 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug DS - uikit
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

I think it may be prudent to use touch.hash() (importing NSObjectProtocol) instead of just converting to a pointer and comparing the address? I'm not entirely sure that the ID will be consistent otherwise, UITouch seems to be an immutable container that also contains e.g. the location of the current touch (so it'll probably change next time we process the specific touch).

Firefox' code seems to rely on inserting the UITouch into a hashmap, to store a stable identifier, so perhaps that's actually what we need to do?

Found while reviewing https://github.com/rust-windowing/winit/pull/3947.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the FingerId implementation and the referenced winit PR 3947, then compare its UITouch handling with Firefox's nsWindow.mm code. Determine whether pointer conversion or touch.hash() provides a stable identifier, and confirm that the chosen approach keeps the same touch mapped to one FingerId across processing updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, rust
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.