Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix screen_get_usable_rect returning display safe area #60553

Merged
merged 1 commit into from
May 3, 2022

Conversation

madmiraal
Copy link
Contributor

When creating #60551, I noticed that #40761 (for iPhone) and #43104 (for Android) had aimed to reimplement the 3.x OS.get_window_safe_area() method. However, instead of recreating the method, they've incorrectly redefined DisplayServer.screen_get_usable_rect(screen), which should return the usable rectangle for the specified screen. On Android and iPhone this should be the full screen not the safe area.

This PR creates the DisplayServer.get_display_safe_area(), which returns the rectangle that is not obscured by cutouts, notches, inserts used by cameras and sensors on some devices, or the full screen rectangle if there are no obstructions, and reverts the changes made to DisplayServer.screen_get_usable_rect(screen) on the Android and iPhone platforms.

@madmiraal madmiraal force-pushed the separate-display_safe_area branch 3 times, most recently from 4a8dc68 to 77608f1 Compare May 2, 2022 07:29
@madmiraal madmiraal force-pushed the separate-display_safe_area branch from 77608f1 to 97e87a2 Compare May 2, 2022 07:31
@akien-mga akien-mga merged commit 3894b08 into godotengine:master May 3, 2022
@akien-mga
Copy link
Member

Thanks!

@madmiraal madmiraal deleted the separate-display_safe_area branch May 3, 2022 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants