webscreens / screen-enumeration

Screen enumeration API explainer
Apache License 2.0
23 stars 4 forks source link

Expose mirrored desktops? #19

Closed markafoltz closed 4 years ago

markafoltz commented 4 years ago

Most OSes allow the primary desktop to be mirrored to a wired secondary display. Often, the resolution of the primary display is reset to match the resolution of the secondary display when mirroring is activated. Mac OS X and ChromeOS support this mode, probably Windows too.

Web applications might want to know when this happens; for example, to trigger presentation mode if you've plugged your laptop into a projector.

Question 1: should the mirrored-to secondary display be returned as a second Screen object?

It's debatable, since for most OSes the properties of the secondary display will match those of the primary display. I would lean towards "no."

Question 2: Should the web application know if the primary display is being locally mirrored?

For the use case outlined above, I would say "yes." We add have a boolean property, screen.mirrored that is set to true for the primary display when it's being mirrored this way.

michaelwasserman commented 4 years ago

My initial inclination is to agree with you on Q1. Mirrored displays ideally wouldn't be listed separately in this API, since they're not independent targets for window placement purposes, and they don't necessarily provide additional value for intersecting screen and window bounds to determine how content is split when presented in a single window across multiple displays.

For Q2, I'm not sure a presentation application would use the signal of whether the display is mirrored elsewhere, but it's worth listing as a possible future addition to gauge interest/value.

michaelwasserman commented 4 years ago

This is briefly mentioned in the additional explorations doc. It's not information we're actively proposing to expose for now, so I'll close this issue.