Skip to content

Add support for the safe area on iOS#7578

Merged
lucasmerlin merged 13 commits intoemilk:mainfrom
irh:ios-safe-area
Oct 7, 2025
Merged

Add support for the safe area on iOS#7578
lucasmerlin merged 13 commits intoemilk:mainfrom
irh:ios-safe-area

Conversation

@irh
Copy link
Copy Markdown
Contributor

@irh irh commented Oct 2, 2025

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:

  • 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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 6, 2025

Preview available at https://egui-pr-preview.github.io/pr/7578-ios-safe-area
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

Copy link
Copy Markdown
Collaborator

@lucasmerlin lucasmerlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for finishing this up!

@lucasmerlin lucasmerlin added eframe Relates to epi and eframe egui-winit porblems related to winit egui feature New feature or request labels Oct 6, 2025
@lucasmerlin lucasmerlin merged commit 3027723 into emilk:main Oct 7, 2025
25 of 26 checks passed
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eframe Relates to epi and eframe egui egui-winit porblems related to winit feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants