Skip to content

Conversation

rectalogic
Copy link
Contributor

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

@alice-i-cecile
Copy link
Member

This was previously working, and broke in #19668.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Windowing Platform-agnostic interface layer to run your app in P-Regression Functionality that used to work but no longer does. Add a test for this! labels Oct 14, 2025
@alice-i-cecile alice-i-cecile added this to the 0.17.3 milestone Oct 14, 2025
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Oct 14, 2025
@alice-i-cecile alice-i-cecile added the P-Crash A sudden unexpected crash label Oct 14, 2025
Copy link
Member

@janhohenheim janhohenheim left a 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

@alice-i-cecile
Copy link
Member

@janhohenheim can you link the winit discussion here for us?

@alice-i-cecile alice-i-cecile added the X-Contentious There are nontrivial implications that should be thought through label Oct 14, 2025
@janhohenheim
Copy link
Member

janhohenheim commented Oct 14, 2025

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Oct 14, 2025

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.

@janhohenheim
Copy link
Member

Fully agreed :)

Copy link
Member

@janhohenheim janhohenheim left a 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!

@janhohenheim janhohenheim added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 14, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 14, 2025
Merged via the queue into bevyengine:main with commit 52b4a2d Oct 14, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash P-Regression Functionality that used to work but no longer does. Add a test for this! S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Contentious There are nontrivial implications that should be thought through

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wasm web panics on iOS Safari with arg0.exitPointerLock is not a function

3 participants