rust-windowing / rust-windowing/winit

Web: make use of `PointerEvent.persistentDeviceId`

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

Nobody has claimed this yet.

DS - web S - enhancement
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Currently PointerEvent.pointerId is used to build DeviceId, however this isn't perfect because the same device can get a new ID when it is disabled during a session. E.g. your mouse is plugged and the unplugged: it will get a new DeviceId. This is especially bad for non-connected (battery-free) pens, which get a new DeviceId every time they leave the maximum hover distance.

For this reason a new PointerEvent.persistentDeviceId was introduced, which identifies a specific device by a unique device ID throughout the whole session.
This is supported by default on Chrome since v128.

W3C
Caniuse
WPT
Firefox Standard Positions
WebKit Standard Positions

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 locating the web input path where PointerEvent.pointerId is used to build DeviceId, then review the PointerEvent.persistentDeviceId specification and browser support linked in the issue. Done means device identity uses the persistent identifier where available and the existing behavior remains covered for unsupported browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.