Ignore viewport size/position on iOS (#4922)

I disabled some code that changes the viewport of iOS devices. 
* [X] I have followed the instructions in the PR template
This commit is contained in:
frederik-uni 2024-08-26 11:34:39 +02:00 committed by GitHub
parent ba80038f3d
commit e9522cf765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 1 deletions

View File

@ -1607,7 +1607,11 @@ pub fn create_winit_window_attributes(
.with_decorations(decorations.unwrap_or(true))
.with_resizable(resizable.unwrap_or(true))
.with_visible(visible.unwrap_or(true))
.with_maximized(maximized.unwrap_or(false))
.with_maximized(if cfg!(target_os = "ios") {
true
} else {
maximized.unwrap_or(false)
})
.with_window_level(match window_level.unwrap_or_default() {
egui::viewport::WindowLevel::AlwaysOnBottom => WindowLevel::AlwaysOnBottom,
egui::viewport::WindowLevel::AlwaysOnTop => WindowLevel::AlwaysOnTop,
@ -1631,6 +1635,7 @@ pub fn create_winit_window_attributes(
})
.with_active(active.unwrap_or(true));
#[cfg(not(target_os = "ios"))]
if let Some(size) = inner_size {
window_attributes = window_attributes.with_inner_size(PhysicalSize::new(
pixels_per_point * size.x,
@ -1638,6 +1643,7 @@ pub fn create_winit_window_attributes(
));
}
#[cfg(not(target_os = "ios"))]
if let Some(size) = min_inner_size {
window_attributes = window_attributes.with_min_inner_size(PhysicalSize::new(
pixels_per_point * size.x,
@ -1645,6 +1651,7 @@ pub fn create_winit_window_attributes(
));
}
#[cfg(not(target_os = "ios"))]
if let Some(size) = max_inner_size {
window_attributes = window_attributes.with_max_inner_size(PhysicalSize::new(
pixels_per_point * size.x,
@ -1652,6 +1659,7 @@ pub fn create_winit_window_attributes(
));
}
#[cfg(not(target_os = "ios"))]
if let Some(pos) = position {
window_attributes = window_attributes.with_position(PhysicalPosition::new(
pixels_per_point * pos.x,