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

Use window.outer_size on iOS #421

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions masonry/src/event_loop_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ impl ApplicationHandler<accesskit_winit::Event> for MainState<'_> {
let adapter = Adapter::with_event_loop_proxy(&window, self.proxy.clone());
window.set_visible(visible);
let window = Arc::new(window);
// https://github.com/rust-windowing/winit/issues/2308
#[cfg(target_os = "ios")]
let size = window.outer_size();
#[cfg(not(target_os = "ios"))]
let size = window.inner_size();
let surface = pollster::block_on(self.render_cx.create_surface(
window.clone(),
Expand All @@ -156,6 +160,10 @@ impl ApplicationHandler<accesskit_winit::Event> for MainState<'_> {
window,
accesskit_adapter,
} => {
// https://github.com/rust-windowing/winit/issues/2308
#[cfg(target_os = "ios")]
let size = window.outer_size();
#[cfg(not(target_os = "ios"))]
let size = window.inner_size();
let surface = pollster::block_on(self.render_cx.create_surface(
window.clone(),
Expand Down Expand Up @@ -379,6 +387,10 @@ impl MainState<'_> {
return;
};
let scale_factor = window.scale_factor();
// https://github.com/rust-windowing/winit/issues/2308
#[cfg(target_os = "ios")]
let size = window.outer_size();
#[cfg(not(target_os = "ios"))]
let size = window.inner_size();
let width = size.width;
let height = size.height;
Expand Down