Add support for the safe area on iOS#7578
Merged
lucasmerlin merged 13 commits intoemilk:mainfrom Oct 7, 2025
Merged
Conversation
…4915) Co-authored-by: lucasmerlin <[email protected]> This is a squashed version of the PR started by @frederik-uni and continued by @lucasmerlin, rebased on to a more recent `master`. emilk#4915
|
Preview available at https://egui-pr-preview.github.io/pr/7578-ios-safe-area |
lucasmerlin
approved these changes
Oct 6, 2025
Collaborator
lucasmerlin
left a comment
There was a problem hiding this comment.
Nice, thanks for finishing this up!
emilk
reviewed
Oct 7, 2025
Masterchef365
pushed a commit
to Masterchef365/egui
that referenced
this pull request
Apr 3, 2026
This PR is a continuation of emilk#4915 by @frederik-uni and @lucasmerlin that introduces support for keeping egui content within the 'safe area' on iOS (avoiding the notch / dynamic island / menu bar etc.), with the following changes: - `SafeArea` now wraps `MarginF32` and has been renamed to `SafeAreaInsets` to clarify its purpose. - `InputState::screen_rect` is now marked as deprecated in favour of either `viewport_rect` (which contains the entire screen), or `content_rect` (which is the viewport rect with the safe area insets removed). - I added some comments to the safe area insets logic pointing out the [safe area API coming in winit v0.31](rust-windowing/winit#3910). --------- Co-authored-by: frederik-uni <[email protected]> Co-authored-by: Lucas Meurer <[email protected]> Co-authored-by: Emil Ernerfeldt <[email protected]>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a continuation of #4915 by @frederik-uni and @lucasmerlin that introduces support for keeping egui content within the 'safe area' on iOS (avoiding the notch / dynamic island / menu bar etc.), with the following changes:
SafeAreanow wrapsMarginF32and has been renamed toSafeAreaInsetsto clarify its purpose.InputState::screen_rectis now marked as deprecated in favour of eitherviewport_rect(which contains the entire screen), orcontent_rect(which is the viewport rect with the safe area insets removed).