-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Do not attempt to grab pointer on web if unsupported. #21534
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
Conversation
This was previously working, and broke in #19668. |
pointerlock unsupported
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 personally want this, but when I argued for better locking support via calling web_sys stuff, @mockersf answer was to instead upstream those things into winit, which is fair.
I tried, but got ghosted by the winit folks. So idk if that "ruling" is still accurate.
But yeah if an SME-Input was against this sorta thing in the past, I cannot in good conscience approve it
@janhohenheim can you link the winit discussion here for us? |
That said, given that this is less about "does winit send correct events" and more about "does winit not crash", this seems more pressing to merge here downstream. |
I'm strongly in favor of this. I think that this is an elegant way to fix this downstream for now, and I don't think we should block this on an upstream fix. Upstream fixes would be great, but we can migrate this to that later. |
Fully agreed :) |
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.
Ah, code looks correct to me!
Objective
Fixes #21497
Solution
Mobile web does not support pointer APIs and panics if they are used. Check if they exist before using them.
Testing
Tested on iOS Safari using https://github.com/rectalogic/pointerlock