w3c / window-management

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

Support for window placement in Wayland #68

Open michaelwasserman opened 2 years ago

michaelwasserman commented 2 years ago

See this excerpt regarding Wayland from our API's recently authored Design Risks document.

Wayland is a replacement for Linux’s X window service. Gnome/Mutter and KDE/Plasma desktops plan to use it. Chrome OS will transition to Ozone/Wayland (see Lacros) with some protocol extensions and additional Ash-integrations via a Mojo side channel. Chrome Browser is also building support to run as an Ozone/Wayland client in Linux desktop environments.

Wayland was explicitly designed to prohibit clients from introspecting or programmatically changing their global window coordinates. “Wayland doesn't provide clients with global screen coordinates.

It is a design decision in Wayland/desktop to not expose absolute window positions to clients at all. This means that you simply cannot know where a top-level window is precisely, you can only know which outputs it overlaps with. - pq

Brief testing of Gnome/Wayland on Debian rodete, and Chrome OS Wayland dogfood indicate that pre-existing and proposed window placement features are quite broken:

Wayland offers these tools to client applications:

Per crbug.com/1261321, Chrome OS plans to support window's positioning in screen/display coordinates. This will likely be via protocol extensions, to avoid message ordering issues between Wayland protocol messages and mojo.

Potential Wayland Protocol Extensions (hand waving by @michaelwasserman):

See this earlier discussion on #ozone-wayland-x11:

How to fail gracefully if coordinate-based placement isn’t supported: