-
Notifications
You must be signed in to change notification settings - Fork 913
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 view frame in portrait when starting iOS app in landscape #1703
Fix view frame in portrait when starting iOS app in landscape #1703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, and for giving some love to iOS support!
I maintain winit on mobile; I don't watch this repo (winit generates a ton of notifications), but I'll always come if pinged!
I'll test this out on an iPhone XR and report back.
0793ac0
to
9df2b01
Compare
@francesca64 I have been testing via Bevy, but I think it would be better if I had a pure winit project setup for testing. That way I could more directly test this PR and any other issues I'm having. I looked over the winit examples but couldn't really find a drop-in sample for iOS. I tried Can you recommend any of the examples or do you happen to have a suitable winit example for iOS? Just something like displaying an image would be enough. This would also be useful for me to try to produce a pure winit crash repro for #1705 |
@MichaelHills I actually have something super cool for that exact purpose, but I probably won't be able to get it to you until tomorrow. |
9df2b01
to
26d4ed0
Compare
No worries take your time. I think the code is good now but I'll feel better if I can repro this PR directly on |
26d4ed0
to
f092a82
Compare
So, I made this thing called cargo-mobile, which you can use to generate a minimal winit program that you can run on device. Hopefully the instructions in the README are easy to follow, but I'll answer any questions. If you want something closer to "something like displaying an image", the |
f092a82
to
9f863b1
Compare
Nice! This is really cool. I managed to get it building the winit and wgpu examples but had to do the following:
The reason I had to run The examples run on macOS, but unfortunately it crashes on my phone.
|
Oh and for |
Thanks for trying it out! I'll fix all those problems soon (we're pushing to officially release it in about a month). With regards to the crash, are you using Rust 1.46.0? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this on my iPhone XR and everything looks good! Thanks so much.
I'm on rust 1.48.0 nightly. I could try rolling back to 1.45.2 to see if it resolves the issue? |
That'd be a big help; I was hitting what appears to be the same issue when I was on 1.46.0, and downgrading to 1.45.2 fixed it for me. You'll also need to |
I updated cargo mobile then switched back to 1.45.2, winit and wgpu templates run fine. Back to 1.48.0 nightly, get the crash again on any of the xamples but the bevy example works in the simulator. Also while building for aarch64-apple-ios I get a huge amount of spam of this |
Thanks for trying that! It sounds like I can bisect this more by comparing our build processes. The spam was an upstream problem, which fortunately doesn't seem to impact the build at all: rust-lang/rust#74427 (comment) |
When I link the static lib
This seems to line up with the backtrace I posted earlier referencing |
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to users[ ] Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior[ ] Created or updated an example program if it would help users understand this functionality[ ] Updated feature matrix, if new features were added or implementedI tested this in simulator + my iPhone 6 using Bevy bevyengine/bevy#87
Might be nice to have at least 1 other person test this as well? Directly on winit rather than on bevy.
This is what the problem looks like. If you start up in portrait mode then everything is fine, auto-rotations all work well. If you start up in landscope mode, its permanently broken even if you rotate.