w3c / window-management

Window Management API
https://www.w3.org/TR/window-management/
Other
95 stars 25 forks source link

Spec: Define the multi-screen origin, clarify primary screen origin definition #64

Closed michaelwasserman closed 2 years ago

michaelwasserman commented 2 years ago

The spec should clearly define the multi-screen origin. It also describes the primary screen origin as being (0,0) by convention, i.e. coinciding with the multi-screen origin; this is not necessarily true. This text and images might help, similarly use/update the explainer's text, and additional_explorations.md's text.

The Multi-Screen Origin: Screen coordinates are defined relative to the multi-screen origin. The mutl-screen origin is determined by the operating system and is often, but not always, co-located with the origin of the primary screen. For example, the operating system may select the origin of a rectangle encompassing all screen bounds as the multi-screen origin, and this may not coincide with the primary screen's origin. The screenshot below demonstrates that example; the primary display is lower than, and to the left of, the secondary display; the multi-screen origin is separate and offscreen.

Some operating systems may instead always use the primary screen's origin as the multi-screen origin in this case, giving the secondary screen negative left and/or top coordinates. Browsers could select a multi-screen origin independently of the operating system, but Chrome has not done so, to be compatible with pre-existing window.screen behavior. image

We should add images to the spec demonstrating screen coordinates vs. the origin of the virtual screen area... here's an example, courtesy of @inexorabletash: image

michaelwasserman commented 2 years ago

This is a valid documentation issue that we should probably address before an API mvp milestone.