-
Notifications
You must be signed in to change notification settings - Fork 907
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
IOS ScreenEdge Corrected Default #1843
Conversation
With IOS' PlatformSpeccificWindowBuilderAttributes the preferred_screen_edges_deferring_system_gestures value was previously set to the default (u8 default). This was an invalid value and caused different crashes under screen edge events. Changing this value to a valid value from the ScreenEdge enum fixes these issues.
I have this as draft while I get more 👀 on it. It's a fairly low risk change for the repo since it only affects IOS and has a pretty obvious/easy to understand outcome. I have tested it on iPhone 12 pro or whatever they're calling it these days with iOS 14.3 and soon to be 14.4. I can't test on simulator on my mac since it's M1 and that workflow is broken right now (last I put any effort into it) w/ Rust and cargo-lipo. If anyone else can test that would be great. If not I can take this out of draft if maintainers are 👍 for that. |
Nice, works for me my iPhone 11 on Bevy. Changing it to |
I am somewhat forced to guess why since we don't have the source for the portion of code that triggers the issue. It's entirely possible that this is a bug on Apple's side. Before I take this out of draft I need to create a blank view purely in objective-c or swift with |
Thinking through this a bit more I think this PR is only masking the problem. Not solving it. Without this change I notice that if I touch on a non-edge then later edge touches are handled correctly. As though something was uninitialized and that first touch initializes things. In my search for a solution to this problem I looked a bit at the touch handler but didn't see anything obvious that stood out as being initialized there. This change is essentially making all of the initial touches (even those on the edge) handled by winit first. Then deferred to the system. Making my hypothesis that something is uninitialized stronger. Anyone have thoughts on what on the winit side is either uninitialized or a call we make to initialize something when a touch is handled? |
@MichaelHills changing to |
I'll try to reproduce the original problem again tonight using |
This PR fixes my iOS crashes whenever I touch my app. |
So as you said, this PR is only masking the problem, but nice find, it gets us closer to the root of the problem! The documentation on
So I'm weary against changing the default to making the application take precedence, but if we can't find the root cause it could be a temporary solution until we do? |
I ended up discovering the same docs back when I was looking at this too and reached the same conclusion -- the default behavior is what you'd expect "out of the box" from winit or similar. I wasn't able to find a clear smoking gun on this one. Ended up just using the release version of winit with the config for ScreenEdge set. I'm of the mind that I should close this PR. The discussion is likely useful to help whomever ends up solving it, but it should be linked in the open issues tracking this. |
Currently whenever I touch the screen the app crashes. Note, that this isn't the real culprit but rather a workaround, for more info see: rust-windowing#1843
With IOS' PlatformSpeccificWindowBuilderAttributes the
preferred_screen_edges_deferring_system_gestures value was previously
set to the default (u8 default). This was an invalid value and caused
different crashes under screen edge events. Changing this value to a
valid value from the ScreenEdge enum fixes these issues.
Fixes #1705 and fixes #1613
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to users