In no signal, we wrap the mouse cursor in a way similar to what Blender does when you move the mouse near the bounds of the window in order to allow the player to continue panning.

This works fine on X11. However, one of the playtesters was using Wayland and observed that the rig would spin when the mouse was teleported from one side of the window to the other.

I was unable to replicate this issue locally, even after changing the graphics settings to try all of the different window modes. So, I suspected that there might be a Wayland-related issue causing the problem.

Looking at the Godot issue tracker, I found a few likely suspects related to warp_mouse not working correctly under Wayland:

godotengine/godot#64296 mentions that warp_mouse doesn’t work at all, and the response is illuminating:

Calinou @ github.com/godotengine/godot#64296: This is likely a Wayland limitation for security reasons. Wayland has a much stricter security model compared to X11, which leads to more limitations (many of them still being unresolved as of 2022).

And godotengine/godot#80008 mentions that warping does do something, but it doesn’t operate correctly in several cases.

It looks like to fix this issue, I would need to merge a fix into Godot upstream. For now, I think it would be better to just add a setting allowing players to turn off the mouse warping behaviour.