Skip to content

Viewer: drop the redundant GLFW_CURSOR_NORMAL call that breaks iOS Safari - #7315

Merged
Grantim merged 1 commit into
masterfrom
fix/web-no-pointer-lock
Oct 29, 2026
Merged

Grantim merged 1 commit into
masterfrom
fix/web-no-pointer-lock

Conversation

@Grantim

@Grantim Grantim commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Since Emscripten 4.0.11 (emscripten-core/emscripten#24603), its GLFW library implements glfwSetInputMode( window, GLFW_CURSOR, GLFW_CURSOR_NORMAL ) with an unguarded document.exitPointerLock(). In browsers without the Pointer Lock API (iOS Safari) that throws TypeError during Viewer::launchInit_, and the web viewer never starts. With emsdk 4.0.10 the call fell back to a no-op.

Reported upstream: emscripten-core/emscripten#28102, with a proposed change in emscripten-core/emscripten#28103.

GLFW_CURSOR_NORMAL is GLFW's default mode, so the call does nothing on desktop. On web, cursor shapes don't go through cursor modes: ImGuiMenu turns off ImGui's GLFW cursor update and sets canvas.style.cursor through customSetCursor.

Test plan:

  • CI builds
  • Web viewer starts in iOS Safari

Generated with Claude Code

…fari

GLFW_CURSOR_NORMAL is GLFW's default cursor mode. Since Emscripten 4.0.11, its GLFW library implements this call with an unguarded document.exitPointerLock(), which throws on browsers without the Pointer Lock API (iOS Safari) and stops the viewer from starting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Grantim
Grantim merged commit 4a160ea into master Oct 29, 2026
62 checks passed
@Grantim
Grantim deleted the fix/web-no-pointer-lock branch October 29, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants