You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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):
xdg_surface:event:geometry - event fired when window geometry initializes or changes.
xdg_surface:request:set_geometry - set window geometry in screen or output coordinates.
xdg_surface:request:set_output - move a non-fullscreen client surface to a specific display.
This may align with existing design principles and precedent.
Useful as a coarse window.moveTo(x,y), or some other new API, to move popups and PWA windows to a target display.
“In Wayland, clients do not know global screen coordinates. That's why WaylandWindow::GetBounds returns 0,0 position” … “That's a security feature”
“you can't know where windows are located on a display. You can only know which display because Wayland sends an event whenever a window changes a display”
“this will effectively break some existing JS web platform APIs, like window.screenX|Y [1] and window.open's left=x,top=y feature string parameters”
“It's probably worth compiling an email and sending to Wayland-dev to start a discussion”
“one can specify display during (maximize?)/fullscreen operation”
xdg_surface:request:set_window_geometry … is “for insetting the window's visible bounds from a decoration like a shadow” and “may also be used to position a toplevel window relative to each other when they are parented”
“Wayland compositor decides the initial position of a new toplevel window. Client cannot control that per se. client is only able to set initial size “ … “It should be decided by exo in ash”
“if a window can't set its global coordinates, it may be useful for a window to at least move itself to a specific display”
“it is relatively easy to add this extension. But I would also like to research if a WIP protocol that does that exists”
“we can do anything we want with exo and come up with any protocol extensions. But do we want to end up with Ozone/Wayland backend that is not comptible with classic Linux wayland approach and result in a very unfriendly and hard maintainable. We should be careful”
“One thing is to add something that is new and not yet supported. And another is modifying the original behavior with protocol extensions. I don't really want the second to happen”
“something new == protocol extension if it complies with wayland core design and ads new functionality”
“To sum up - it sounds ok to me to add an extension that would allow to specify a display where a window should be shown. But it's also worth checking if any WIP protocols exist that already do that.”
“creating a new extension to overcome an existing design decision is not something I'd like to support :)”
How to fail gracefully if coordinate-based placement isn’t supported:
Best effort, maybe move to display matching coordinates?
Try to let callers know that coordinate placement isn’t supported?
What granularity would this provide? E.g. Wayland lets clients set sizes and choose a display for fullscreen, but not get/set non-fullscreen positions.
The text was updated successfully, but these errors were encountered:
… screen.availHeight and screen.availWidth
https://bugs.webkit.org/show_bug.cgi?id=278511
Reviewed by NOBODY (OOPS!).
Add new wpe_monitor_get_available_width/height API to report the
available screen size. This is used to feed JS's
screen.availWidth/availHeight[1]. If not possible to detect the available
dimensions, fallback to the previous behavior of using the whole screen
size, as it's also one of the accepted values in the spec:
> The Web-exposed available screen area is one of the following:
> The available area of the rendering surface of the output device, in CSS pixels.
> The area of the output device, in CSS pixels.
https://drafts.csswg.org/cssom-view/#dom-screen-availw
In Wayland, use the `xdg_toplevel::configure_bounds` event to get the
information from the compositor. Given Wayland design decisions, we
can't get the actual screen position of the client, so we default to
(0,0).
This is not a problem regarding the `availWidth/availHeight`,
which is the information settled currently in the CSS spec. For the
record, this position limitation might become an issue when Window
Management's `availLeft/availTop`[2] eventually become an accepted
standard. This limitation is described in the Window Management github,
in [3].
[1] https://developer.mozilla.org/en-US/docs/Web/API/Screen/availHeight
[2] https://w3c.github.io/window-management/#ref-for-dom-screendetailed-availleft
[3] w3c/window-management#68
* Source/WebKit/UIProcess/wpe/ScreenManagerWPE.cpp:
(WebKit::ScreenManager::collectScreenProperties const):
* Source/WebKit/WPEPlatform/wpe/WPEMonitor.cpp:
(wpeMonitorGetProperty):
(wpe_monitor_class_init):
(wpe_monitor_get_available_width):
(wpe_monitor_get_available_height):
(wpe_monitor_set_available_size):
* Source/WebKit/WPEPlatform/wpe/WPEMonitor.h:
* Source/WebKit/WPEPlatform/wpe/wayland/WPEDisplayWayland.cpp:
* Source/WebKit/WPEPlatform/wpe/wayland/WPEToplevelWayland.cpp:
(wpeToplevelWaylandConstructed):
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.”
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:
left=x,top=y
features are always disregardedwidth=w,height=h
are respectedWayland 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:
maximize?)/fullscreen operation”How to fail gracefully if coordinate-based placement isn’t supported:
The text was updated successfully, but these errors were encountered: