Skip to content

What is the most stable monitor identifier in winit #2705

Answered by madsmtm
ncallaway asked this question in Q&A
Discussion options

You must be logged in to vote

winit::platform::*::MonitorHandleExt*::native_id is somewhat stable on Linux-like platforms.

Android, Redox and web only support one monitor, so on those you can simply use the primary monitor.

macOS doesn't expose it, but has a way to get a unique ID for a monitor (which it uses in comparisons).

The monitor support on iOS is very spotty, so I doubt it's possible to get a stable identifier for monitors here.

I also can't seem to find any information on the stability of Windows' HMONITOR.


It might be possible for us to create a unified API over these (uses the exact ID where possible, a best-effort match on iOS and Windows, and falling back to the primary monitor otherwise), though unsure…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ncallaway
Comment options

Answer selected by ncallaway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants