forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WPE] Consider actual available size instead of whole screen size for…
… 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):
- Loading branch information
1 parent
77eec0a
commit eeb1b75
Showing
5 changed files
with
115 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters